From: James Simmons Date: Tue, 3 Dec 2013 17:31:57 +0000 (-0500) Subject: LU-4015 ldiskfs: access external journal using device path X-Git-Tag: 2.4.2-RC1~1 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F71%2F8471%2F2;p=fs%2Flustre-release.git LU-4015 ldiskfs: access external journal using device path Currently ldiskfs when configured with an external journal uses the device number to access it. The problem with this approach is that the device number can change across reboots. This patch adds a new mount option -o journal_path to tell ldiskfs where the external journal is instead. This patch is based on commit landed to what will be Lustre 2.6 which is d406aa3e71cde588ea53d42ff2596d77e65e33f8. Signed-off-by: James Simmons Change-Id: I86af198cdab54164583ae1c03fff891edfc1f152 Reviewed-on: http://review.whamcloud.com/8471 Reviewed-by: Andreas Dilger Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Nunez Reviewed-by: Oleg Drokin --- diff --git a/ldiskfs/kernel_patches/patches/rhel6.3/ext4-journal-path-opt.patch b/ldiskfs/kernel_patches/patches/rhel6.3/ext4-journal-path-opt.patch new file mode 100644 index 0000000..73d7839 --- /dev/null +++ b/ldiskfs/kernel_patches/patches/rhel6.3/ext4-journal-path-opt.patch @@ -0,0 +1,67 @@ +diff -ur linux-stage.orig/fs/ext4/super.c linux-stage/fs/ext4/super.c +--- linux-stage.orig/fs/ext4/super.c 2013-09-26 11:25:51.970361560 -0400 ++++ linux-stage/fs/ext4/super.c 2013-09-26 11:46:25.078236831 -0400 +@@ -1274,7 +1274,7 @@ + Opt_user_xattr, Opt_nouser_xattr, Opt_acl, Opt_noacl, + Opt_auto_da_alloc, Opt_noauto_da_alloc, Opt_noload, Opt_nobh, Opt_bh, + Opt_commit, Opt_min_batch_time, Opt_max_batch_time, +- Opt_journal_update, Opt_journal_dev, ++ Opt_journal_update, Opt_journal_dev, Opt_journal_path, + Opt_journal_checksum, Opt_journal_async_commit, + Opt_abort, Opt_data_journal, Opt_data_ordered, Opt_data_writeback, + Opt_data_err_abort, Opt_data_err_ignore, +@@ -1323,6 +1323,7 @@ + {Opt_max_batch_time, "max_batch_time=%u"}, + {Opt_journal_update, "journal=update"}, + {Opt_journal_dev, "journal_dev=%u"}, ++ {Opt_journal_path, "journal_path=%s"}, + {Opt_journal_checksum, "journal_checksum"}, + {Opt_journal_async_commit, "journal_async_commit"}, + {Opt_abort, "abort"}, +@@ -1533,6 +1534,46 @@ + return 0; + *journal_devnum = option; + break; ++ case Opt_journal_path: { ++ char *journal_path; ++ struct inode *journal_inode; ++ struct path path; ++ int error; ++ ++ if (is_remount) { ++ ext4_msg(sb, KERN_ERR, ++ "Cannot specify journal on remount"); ++ return -1; ++ } ++ journal_path = match_strdup(&args[0]); ++ if (!journal_path) { ++ ext4_msg(sb, KERN_ERR, "error: could not dup " ++ "journal device string"); ++ return -1; ++ } ++ ++ error = kern_path(journal_path, LOOKUP_FOLLOW, &path); ++ if (error) { ++ ext4_msg(sb, KERN_ERR, "error: could not find " ++ "journal device path: error %d", error); ++ kfree(journal_path); ++ return -1; ++ } ++ ++ journal_inode = path.dentry->d_inode; ++ if (!S_ISBLK(journal_inode->i_mode)) { ++ ext4_msg(sb, KERN_ERR, "error: journal path %s " ++ "is not a block device", journal_path); ++ path_put(&path); ++ kfree(journal_path); ++ return -1; ++ } ++ ++ *journal_devnum = new_encode_dev(journal_inode->i_rdev); ++ path_put(&path); ++ kfree(journal_path); ++ break; ++ } + case Opt_journal_checksum: + set_opt(sbi->s_mount_opt, JOURNAL_CHECKSUM); + break; diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.4.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.4.series index 6fd2bab..421716d 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.4.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.4.series @@ -42,3 +42,4 @@ rhel6.3/ext4-quota-first-class.patch rhel6.3/ext4-inode_info_reorganize.patch rhel6.4/ext4-fix-mbgroups-access.patch rhel6.3/ext4-fix-ext4_mb_add_n_trim.patch +rhel6.3/ext4-journal-path-opt.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.series index e051972..4bc8247 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.series @@ -41,3 +41,4 @@ rhel6.3/ext4-quota-first-class.patch rhel6.3/ext4-inode_info_reorganize.patch rhel6.3/ext4-fix-mbgroups-access.patch rhel6.3/ext4-fix-ext4_mb_add_n_trim.patch +rhel6.3/ext4-journal-path-opt.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series index 2c35389..54cd768 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series @@ -41,3 +41,4 @@ rhel6.3/ext4-quota-force-block-alloc-quotaoff.patch rhel6.3/ext4-quota-dont-update-cmtime.patch rhel6.3/ext4-quota-first-class.patch rhel6.3/ext4-fix-ext4_mb_add_n_trim.patch +rhel6.3/ext4-journal-path-opt.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11.series b/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11.series index 3f3f6dd..e68884a 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11.series @@ -42,3 +42,4 @@ rhel6.3/ext4-nocmtime-2.6.patch rhel6.3/ext4-export-64bit-name-hash.patch sles11sp2/ext4-store-tree-generation-at-find.patch sles11sp2/ext4_pdirop.patch +rhel6.3/ext4-journal-path-opt.patch