add jbd2 speedup patches
[ext4-patch-queue.git] / fix-swap_inode_boot_loader-cleanup
blob725bb5a895337978a00d4fd8f95e6f72696675b6
1 ext4: fix error paths in swap_inode_boot_loader() 
3 From: Zheng Liu <wenqing.lz@taobao.com>
5 In swap_inode_boot_loader() we forgot to release ->i_mutex and resume
6 unlocked dio for inode and inode_bl if there is an error starting the
7 journal handle.  This commit fixes this issue.
9 Reported-by: Ahmed Tamrawi <ahmedtamrawi@gmail.com>
10 Cc: Andreas Dilger <adilger.kernel@dilger.ca>
11 Cc: Dr. Tilmann Bubeck <t.bubeck@reinform.de>
12 Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
13 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
14 Cc: stable@vger.kernel.org  # v3.10+
15 ---
16  fs/ext4/ioctl.c |    3 ++-
17  1 file changed, 2 insertions(+), 1 deletion(-)
19 diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
20 index 6bea806..a2a837f 100644
21 --- a/fs/ext4/ioctl.c
22 +++ b/fs/ext4/ioctl.c
23 @@ -140,7 +140,7 @@ static long swap_inode_boot_loader(struct super_block *sb,
24         handle = ext4_journal_start(inode_bl, EXT4_HT_MOVE_EXTENTS, 2);
25         if (IS_ERR(handle)) {
26                 err = -EINVAL;
27 -               goto swap_boot_out;
28 +               goto journal_err_out;
29         }
31         /* Protect extent tree against block allocations via delalloc */
32 @@ -198,6 +198,7 @@ static long swap_inode_boot_loader(struct super_block *sb,
34         ext4_double_up_write_data_sem(inode, inode_bl);
36 +journal_err_out:
37         ext4_inode_resume_unlocked_dio(inode);
38         ext4_inode_resume_unlocked_dio(inode_bl);
40 -- 
41 1.7.9.7
44 To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
45 the body of a message to majordomo@vger.kernel.org
46 More majordomo info at  http://vger.kernel.org/majordomo-info.html