[PATCH 1/1] PMFS: Fix a bug in zeroing of a partial block

Vishal Verma vishal.l.verma at linux.intel.com
Fri Aug 23 12:52:39 EDT 2013


In the write path, the range of allocated blocks that will be
written to in whole is not zeroed, but there are special cases
to check for edge blocks and zero those. One of these cases had
a bogus condition.

Signed-off-by: Vishal Verma <vishal.l.verma at linux.intel.com>
---
 fs/pmfs/xip.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/fs/pmfs/xip.c b/fs/pmfs/xip.c
index a7cf780..dd11d43 100644
--- a/fs/pmfs/xip.c
+++ b/fs/pmfs/xip.c
@@ -252,8 +252,7 @@ ssize_t pmfs_xip_file_write(struct file *filp, const char __user *buf,
 		if (pmfs_find_data_block(inode, start_blk) == 0)
 		    new_sblk = true;
 	}
-	if (((count + offset - 1) >> pmfs_inode_blk_shift(pi)) != 0 &&
-			((pos + count) & (pmfs_inode_blk_size(pi) - 1)) != 0) {
+	if (((pos + count) & (pmfs_inode_blk_size(pi) - 1)) != 0) {
 		if (pmfs_find_data_block(inode, start_blk + num_blocks - 1)
 			== 0)
 		    new_eblk = true;
-- 
1.7.0.4




More information about the Linux-pmfs mailing list