add patch remove-redundant-condition-check
[ext4-patch-queue.git] / missing-unlock-put-page-in-ext4_try_to_write_inline_data
bloba7180eea459d07224db947f07b42ce0f277026db
1 ext4: missing unlock/put_page() in ext4_try_to_write_inline_data()
3 From:   Maurizio Lombardi <mlombard@redhat.com>
5 In case of error, ext4_try_to_write_inline_data() should unlock
6 and release the page it holds.
8 Fixes: f19d5870cbf7 ("ext4: add normal write support for inline data")
9 Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
10 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 ---
12  fs/ext4/inline.c | 5 ++++-
13  1 file changed, 4 insertions(+), 1 deletion(-)
15 diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
16 index 9c4bac1..27373d8 100644
17 --- a/fs/ext4/inline.c
18 +++ b/fs/ext4/inline.c
19 @@ -705,8 +705,11 @@ int ext4_try_to_write_inline_data(struct address_space *mapping,
21         if (!PageUptodate(page)) {
22                 ret = ext4_read_inline_page(inode, page);
23 -               if (ret < 0)
24 +               if (ret < 0) {
25 +                       unlock_page(page);
26 +                       put_page(page);
27                         goto out_up_read;
28 +               }
29         }
31         ret = 1;
32 -- 
33 Maurizio Lombardi