[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1559317851-3861-1-git-send-email-liu.xiang6@zte.com.cn>
Date: Fri, 31 May 2019 23:50:51 +0800
From: Liu Xiang <liu.xiang6@....com.cn>
To: viro@...iv.linux.org.uk
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
liuxiang_1999@....com, Liu Xiang <liu.xiang6@....com.cn>
Subject: [PATCH v2] fs: buffer: fix fully_mapped reset in block_read_full_page()
Because get_block() might set the buffer mapped, fully_mapped reset
should be done according to the result of buffer_mapped(bh)
which check the buffer mapped attribute again after get_block().
Signed-off-by: Liu Xiang <liu.xiang6@....com.cn>
---
Changes in v2:
change comment
fs/buffer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/buffer.c b/fs/buffer.c
index e450c55..987aadb 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2243,7 +2243,6 @@ int block_read_full_page(struct page *page, get_block_t *get_block)
if (!buffer_mapped(bh)) {
int err = 0;
- fully_mapped = 0;
if (iblock < lblock) {
WARN_ON(bh->b_size != blocksize);
err = get_block(inode, iblock, bh, 0);
@@ -2251,6 +2250,7 @@ int block_read_full_page(struct page *page, get_block_t *get_block)
SetPageError(page);
}
if (!buffer_mapped(bh)) {
+ fully_mapped = 0;
zero_user(page, i * blocksize, blocksize);
if (!err)
set_buffer_uptodate(bh);
--
1.9.1
Powered by blists - more mailing lists