]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
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 cc3c39ded2e6714c8deb8f441370faab6e5c1e68..414dd1166395783135c972e90efd47b78a345892 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);