Whamcloud - gitweb
LU-5771 ldiskfs: cleanup orphan inode in error path 49/12349/5
authorWang Shilong <wshilong@ddn.com>
Mon, 20 Oct 2014 12:41:03 +0000 (20:41 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 17 Dec 2014 17:48:02 +0000 (17:48 +0000)
Commit from upstream: 4538821993f4486c76090dfb377c60c0a0e71ba3

There were some error paths in ext4_delete_inode() which was not
dropping the inode from the orphan list.  This could lead to a BUG_ON
on umount when the orphan list is discovered to be non-empty.

Signed-off-by: Wang Shilong <wshilong@ddn.com>
Change-Id: Ica2c87ae378cc23eed70c1bfeb96db3852d218dc
Reviewed-on: http://review.whamcloud.com/12349
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
ldiskfs/kernel_patches/patches/rhel6.3/ext4-drop-inode-from-orphan-list-if-ext4_delete_inode-fails.patch [new file with mode: 0644]
ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.4.series
ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.5.series
ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.6.series

diff --git a/ldiskfs/kernel_patches/patches/rhel6.3/ext4-drop-inode-from-orphan-list-if-ext4_delete_inode-fails.patch b/ldiskfs/kernel_patches/patches/rhel6.3/ext4-drop-inode-from-orphan-list-if-ext4_delete_inode-fails.patch
new file mode 100644 (file)
index 0000000..54fde81
--- /dev/null
@@ -0,0 +1,22 @@
+commit 4538821993f4486c76090dfb377c60c0a0e71ba3
+Author: Theodore Ts'o <tytso@mit.edu>
+Date:   Thu Jul 29 15:06:10 2010 -0400
+
+    ext4: drop inode from orphan list if ext4_delete_inode() fails
+    
+    There were some error paths in ext4_delete_inode() which was not
+    dropping the inode from the orphan list.  This could lead to a BUG_ON
+    on umount when the orphan list is discovered to be non-empty.
+    
+Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
+Signed-off-by: Wang Shilong <wshilong@ddn.com>
+--- linux-stage.orig/fs/ext4/inode.c   2014-10-20 20:13:39.689001531 +0800
++++ linux-stage/fs/ext4/inode.c        2014-10-20 20:12:14.224997168 +0800
+@@ -279,6 +279,7 @@
+                                    "couldn't extend journal (err %d)", err);
+               stop_handle:
+                       ext4_journal_stop(handle);
++                      ext4_orphan_del(NULL, inode);
+                       sb_end_intwrite(inode->i_sb);
+                       goto no_delete;
+               }
index 3f7db37..ae4ae28 100644 (file)
@@ -48,3 +48,4 @@ rhel6.4/ext4-max-dir-size-options.patch
 rhel6.3/ext4-not-discard-preallocation-umount.patch
 rhel6.3/ext4-journal-path-opt.patch
 rhel6.3/ext4-recalc-percpu-counters-after-journal.patch
+rhel6.3/ext4-drop-inode-from-orphan-list-if-ext4_delete_inode-fails.patch
index fbbac67..2d5ba77 100644 (file)
@@ -48,3 +48,4 @@ rhel6.3/ext4-max-dir-size.patch
 rhel6.4/ext4-max-dir-size-options.patch
 rhel6.3/ext4-not-discard-preallocation-umount.patch
 rhel6.3/ext4-journal-path-opt.patch
+rhel6.3/ext4-drop-inode-from-orphan-list-if-ext4_delete_inode-fails.patch
index d43f5d6..0c40d6c 100644 (file)
@@ -47,3 +47,4 @@ rhel6.3/ext4-max-dir-size.patch
 rhel6.4/ext4-max-dir-size-options.patch
 rhel6.3/ext4-not-discard-preallocation-umount.patch
 rhel6.3/ext4-journal-path-opt.patch
+rhel6.3/ext4-drop-inode-from-orphan-list-if-ext4_delete_inode-fails.patch