Whamcloud - gitweb
LU-4015 ldiskfs: access external journal using device path 71/8471/2
authorJames Simmons <uja.ornl@gmail.com>
Tue, 3 Dec 2013 17:31:57 +0000 (12:31 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 17 Dec 2013 05:39:45 +0000 (05:39 +0000)
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 <uja.ornl@gmail.com>
Change-Id: I86af198cdab54164583ae1c03fff891edfc1f152
Reviewed-on: http://review.whamcloud.com/8471
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
ldiskfs/kernel_patches/patches/rhel6.3/ext4-journal-path-opt.patch [new file with mode: 0644]
ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.4.series
ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.series
ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series
ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11.series

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 (file)
index 0000000..73d7839
--- /dev/null
@@ -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;
index 6fd2bab..421716d 100644 (file)
@@ -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
index e051972..4bc8247 100644 (file)
@@ -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
index 2c35389..54cd768 100644 (file)
@@ -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
index 3f3f6dd..e68884a 100644 (file)
@@ -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