From: Dmitriy Monakhov <dmonakhov@sw.ru>
To: linux-kernel@vger.kernel.org
Cc: npiggin@suse.de
Subject: [patch] new aop block_write_begin fix
Date: Wed, 13 Jun 2007 17:50:07 +0400 [thread overview]
Message-ID: <20070613135007.GC13815@localhost.sw.ru> (raw)
In-Reply-To: <20070613134005.GA13815@localhost.sw.ru>
After we enter to block_write_begin with *pagep == NULL and
some page was grabed we remember this page in *pagep
And if __block_prepare_write() we have to clear *pagep , as
it was before. Because this may confuse caller.
for example caller may have folowing code:
ret = block_write_begin(..., pagep,...)
if (ret && *pagep != NULL) {
unlock_page(*pagep);
page_cache_release(*pagep);
}
Signed-off-by: Dmitriy Monakhov <dmonakhov@openvz.org>
diff --git a/fs/buffer.c b/fs/buffer.c
index 07cd457..df933ba 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -1982,6 +1982,7 @@ int block_write_begin(struct file *file, struct address_space *mapping,
if (ownpage) {
unlock_page(page);
page_cache_release(page);
+ *pagep = NULL;
/*
* prepare_write() may have instantiated a few blocks
next prev parent reply other threads:[~2007-06-13 10:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200705292119.l4TLJtAD011726@shell0.pdx.osdl.net>
2007-06-13 13:40 ` + fs-introduce-write_begin-write_end-and-perform_write-aops.patch added to -mm tree Dmitriy Monakhov
2007-06-13 11:43 ` Nick Piggin
2007-06-13 18:51 ` Dmitriy Monakhov
2007-06-13 23:07 ` Badari Pulavarty
2007-06-13 23:28 ` Nick Piggin
2007-06-14 9:52 ` Jan Kara
2007-06-14 10:39 ` Nick Piggin
2007-06-13 13:50 ` Dmitriy Monakhov [this message]
2007-06-13 13:57 ` iov_iter_fault_in_readable fix Dmitriy Monakhov
2007-06-14 17:31 ` Christoph Hellwig
2007-06-14 22:21 ` David Chinner
2007-06-14 22:34 ` Christoph Hellwig
2007-06-16 18:17 ` Dmitriy Monakhov
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=20070613135007.GC13815@localhost.sw.ru \
--to=dmonakhov@sw.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=npiggin@suse.de \
/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