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 <[EMAIL PROTECTED]>
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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/