linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: missing unlock/put_page() in ext4_try_to_write_inline_data()
@ 2018-11-27  9:25 Maurizio Lombardi
  2018-12-04  5:12 ` Theodore Y. Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Maurizio Lombardi @ 2018-11-27  9:25 UTC (permalink / raw)
  To: tytso; +Cc: linux-ext4, lczerner

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

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-12-04  5:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-27  9:25 [PATCH] ext4: missing unlock/put_page() in ext4_try_to_write_inline_data() Maurizio Lombardi
2018-12-04  5:12 ` Theodore Y. Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).