linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maurizio Lombardi <mlombard@redhat.com>
To: tytso@mit.edu
Cc: linux-ext4@vger.kernel.org, lczerner@redhat.com
Subject: [PATCH] ext4: missing unlock/put_page() in ext4_try_to_write_inline_data()
Date: Tue, 27 Nov 2018 10:25:05 +0100	[thread overview]
Message-ID: <1543310705-11051-1-git-send-email-mlombard@redhat.com> (raw)

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

             reply	other threads:[~2018-11-27 20:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-27  9:25 Maurizio Lombardi [this message]
2018-12-04  5:12 ` [PATCH] ext4: missing unlock/put_page() in ext4_try_to_write_inline_data() Theodore Y. Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1543310705-11051-1-git-send-email-mlombard@redhat.com \
    --to=mlombard@redhat.com \
    --cc=lczerner@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).