Whamcloud - gitweb
e2fsck: Do blkid interpretation on the external journal specifier
authorTheodore Ts'o <tytso@mit.edu>
Mon, 6 Dec 2010 22:07:27 +0000 (17:07 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 6 Dec 2010 22:07:27 +0000 (17:07 -0500)
If the user specifies "e2fsck -j UUID=XXX", e2fsck should do blkid
interpretation, since e2fsck does it with the base file system name.
So from the sake of consistency and user convenience, we should do it
here too.

Addresses-Debian-Bug: #559315

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
e2fsck/unix.c

index cc3c39d..414dd11 100644 (file)
@@ -750,7 +750,14 @@ static errcode_t PRS(int argc, char *argv[], e2fsck_t *ret_ctx)
                                goto sscanf_err;
                        break;
                case 'j':
-                       ctx->journal_name = string_copy(ctx, optarg, 0);
+                       ctx->journal_name = blkid_get_devname(ctx->blkid,
+                                                             optarg, NULL);
+                       if (!ctx->journal_name) {
+                               com_err(ctx->program_name, 0,
+                                       _("Unable to resolve '%s'"),
+                                       optarg);
+                               fatal_error(ctx, 0);
+                       }
                        break;
                case 'P':
                        res = sscanf(optarg, "%d", &ctx->process_inode_size);