diff options
author | Jan Kara <jack@suse.cz> | 2016-05-16 17:17:04 +0200 |
---|---|---|
committer | Vishal Verma <vishal.l.verma@intel.com> | 2016-05-17 00:41:24 -0600 |
commit | 9b6cd5f76d60b563d75e55e432e03ed134761432 (patch) | |
tree | 27415537e52ba2cfad0561fb16dca945efcfab36 /fs/ext2 | |
parent | 02fbd139759feb1f331cebd858523b5d774082e6 (diff) | |
download | linux-9b6cd5f76d60b563d75e55e432e03ed134761432.tar.bz2 |
ext2: Fix block zeroing in ext2_get_blocks() for DAX
When zeroing allocated blocks for DAX, we accidentally zeroed only the
first allocated block instead of all of them. So far this problem is
hidden by the fact that page faults always need only a single block and
DAX write code zeroes blocks again. But the zeroing in DAX code is racy
and needs to be removed so fix the zeroing in ext2 to zero all allocated
blocks.
Reported-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
Diffstat (limited to 'fs/ext2')
-rw-r--r-- | fs/ext2/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index 6bd58e6ff038..038d0ed5f565 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -740,7 +740,7 @@ static int ext2_get_blocks(struct inode *inode, err = dax_clear_sectors(inode->i_sb->s_bdev, le32_to_cpu(chain[depth-1].key) << (inode->i_blkbits - 9), - 1 << inode->i_blkbits); + count << inode->i_blkbits); if (err) { mutex_unlock(&ei->truncate_mutex); goto cleanup; |