From: Taesoo Kim <tsgatesv@gmail.com>
To: zyan@redhat.com, sage@redhat.com, ceph-devel@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: taesoo@gatech.edu, changwoo@gatech.edu, sanidhya@gatech.edu,
blee@gatech.edu, csong84@gatech.edu,
Taesoo Kim <tsgatesv@gmail.com>
Subject: [PATCH 1/1] ceph: properly release page upon error
Date: Fri, 20 Mar 2015 17:36:56 -0400 [thread overview]
Message-ID: <1426887416-27312-1-git-send-email-tsgatesv@gmail.com> (raw)
When ceph_update_writeable_page fails (including -EAGAIN), it
unlocks (w/ unlock_page) the page but does not 'release'
(w/ page_cache_release) properly.
Upon error, properly set *pagep to NULL, indicating an error.
Signed-off-by: Taesoo Kim <tsgatesv@gmail.com>
---
fs/ceph/addr.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index fd5599d..89091e3 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -1146,6 +1146,10 @@ static int ceph_write_begin(struct file *file, struct address_space *mapping,
inode, page, (int)pos, (int)len);
r = ceph_update_writeable_page(file, pos, len, page);
+ if (r) {
+ page_cache_release(page);
+ *pagep = NULL;
+ }
} while (r == -EAGAIN);
return r;
--
2.3.3
next reply other threads:[~2015-03-20 21:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-20 21:36 Taesoo Kim [this message]
2015-03-23 3:37 ` 严正
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=1426887416-27312-1-git-send-email-tsgatesv@gmail.com \
--to=tsgatesv@gmail.com \
--cc=blee@gatech.edu \
--cc=ceph-devel@vger.kernel.org \
--cc=changwoo@gatech.edu \
--cc=csong84@gatech.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=sage@redhat.com \
--cc=sanidhya@gatech.edu \
--cc=taesoo@gatech.edu \
--cc=zyan@redhat.com \
/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
all inboxes | Powered by JetHome®