2018-11-27 20:22:32

by Maurizio Lombardi

[permalink] [raw]
Subject: [PATCH] ext4: missing unlock/put_page() in ext4_try_to_write_inline_data()

In case of error, ext4_try_to_write_inline_data() should unlock
and release the page it holds.

Signed-off-by: Maurizio Lombardi <[email protected]>
---
fs/ext4/inline.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
index 9c4bac1..27373d8 100644
--- a/fs/ext4/inline.c
+++ b/fs/ext4/inline.c
@@ -705,8 +705,11 @@ int ext4_try_to_write_inline_data(struct address_space *mapping,

if (!PageUptodate(page)) {
ret = ext4_read_inline_page(inode, page);
- if (ret < 0)
+ if (ret < 0) {
+ unlock_page(page);
+ put_page(page);
goto out_up_read;
+ }
}

ret = 1;
--
Maurizio Lombardi


2018-12-04 05:12:13

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [PATCH] ext4: missing unlock/put_page() in ext4_try_to_write_inline_data()

On Tue, Nov 27, 2018 at 10:25:05AM +0100, Maurizio Lombardi wrote:
> In case of error, ext4_try_to_write_inline_data() should unlock
> and release the page it holds.
>
> Signed-off-by: Maurizio Lombardi <[email protected]>

Thanks, applied.

- Ted