add patch make-sure-all-temp-bh-fields-are-initialized
[ext4-patch-queue.git] / fix-ref-counting-for-ea_inode
blob693879d8733b27bf7537848deba814007128c61a
1 ext4: fix ref counting for ea_inode
3 From: Tahsin Erdogan <tahsin@google.com>
5 The ref count on ea_inode is incremented by
6 ext4_xattr_inode_orphan_add() which is supposed to be decremented by
7 ext4_xattr_inode_array_free(). The decrement is conditioned on whether
8 the ea_inode is currently on the orphan list. However, the orphan list
9 addition only happens when journaling is enabled. In non-journaled case,r
10 we fail to release the ref count causing an error message like below.
12 "VFS: Busy inodes after unmount of sdb. Self-destruct in 5 seconds.
13 Have a nice day..."
15 Signed-off-by: Tahsin Erdogan <tahsin@google.com>
16 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
17 ---
18  fs/ext4/xattr.c | 3 +--
19  1 file changed, 1 insertion(+), 2 deletions(-)
21 diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
22 index 32ad2f2870e9..13daf634244b 100644
23 --- a/fs/ext4/xattr.c
24 +++ b/fs/ext4/xattr.c
25 @@ -2098,8 +2098,7 @@ ext4_xattr_inode_array_free(struct inode *inode,
26                 if (err)
27                         continue;
28                 /* for inode's i_count get from ext4_xattr_delete_inode */
29 -               if (!list_empty(&EXT4_I(ea_inode)->i_orphan))
30 -                       iput(ea_inode);
31 +               iput(ea_inode);
32                 clear_nlink(ea_inode);
33                 iput(ea_inode);
34         }
35 -- 
36 2.13.1.611.g7e3b11ae1-goog