Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1547155

[PATCH] clean_bdev_aliases: Prevent cleaning blocks that are not in block range

From Chandan Rajendra <chandan@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject [PATCH] clean_bdev_aliases: Prevent cleaning blocks that are not in block range
Date 2016-12-25 14:40 +0100
Message-ID <sShbP-5Lf-3@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


The first block to be cleaned may start at a non-zero page offset. In
such a scenario clean_bdev_aliases() will end up cleaning blocks that
do not fall in the range of blocks to be cleaned. This commit fixes the
issue by skipping blocks that do not fall in valid block range.

Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
---
 fs/buffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/buffer.c b/fs/buffer.c
index 1df2bd5..28484b3 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -1660,7 +1660,7 @@ void clean_bdev_aliases(struct block_device *bdev, sector_t block, sector_t len)
 			head = page_buffers(page);
 			bh = head;
 			do {
-				if (!buffer_mapped(bh))
+				if (!buffer_mapped(bh) || (bh->b_blocknr < block))
 					goto next;
 				if (bh->b_blocknr >= block + len)
 					break;
-- 
2.5.5

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] clean_bdev_aliases: Prevent cleaning blocks that are not in block range Chandan Rajendra <chandan@linux.vnet.ibm.com> - 2016-12-25 14:40 +0100
  Re: [PATCH] clean_bdev_aliases: Prevent cleaning blocks that are not  in block range Jan Kara <jack@suse.cz> - 2017-01-02 17:00 +0100
    Re: [PATCH] clean_bdev_aliases: Prevent cleaning blocks that are not  in block range Eryu Guan <guaneryu@gmail.com> - 2017-01-02 17:30 +0100
      Re: [PATCH] clean_bdev_aliases: Prevent cleaning blocks that are not  in block range Jan Kara <jack@suse.cz> - 2017-01-02 17:50 +0100
  Re: [PATCH] clean_bdev_aliases: Prevent cleaning blocks that are not  in block range Jens Axboe <axboe@kernel.dk> - 2017-01-02 17:40 +0100

csiph-web