summaryrefslogtreecommitdiff
path: root/fs/ext2/xattr.c
diff options
context:
space:
mode:
authorChengguang Xu <cgxu519@zoho.com.cn>2019-07-23 14:21:54 +0300
committerJan Kara <jack@suse.cz>2019-07-31 13:04:42 +0300
commite5d395974e043cdcedcd84a0d41aaebb723786d8 (patch)
tree8ff04266c012c2ac4a3449149a9da23e3d489952 /fs/ext2/xattr.c
parent6fbacb8539a6659d446a9efabb538cfc007c1427 (diff)
downloadlinux-e5d395974e043cdcedcd84a0d41aaebb723786d8.tar.xz
ext2: fix block range in ext2_data_block_valid()
For block validity we should check the block range from start_block to start_block + count - 1, so fix the range in ext2_data_block_valid() and also modify the count argument properly in calling place. Signed-off-by: Chengguang Xu <cgxu519@zoho.com.cn> Link: https://lore.kernel.org/r/20190723112155.20329-1-cgxu519@zoho.com.cn Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext2/xattr.c')
-rw-r--r--fs/ext2/xattr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c
index 79369c13cc55..0456bc990b5e 100644
--- a/fs/ext2/xattr.c
+++ b/fs/ext2/xattr.c
@@ -794,7 +794,7 @@ ext2_xattr_delete_inode(struct inode *inode)
if (!EXT2_I(inode)->i_file_acl)
goto cleanup;
- if (!ext2_data_block_valid(sbi, EXT2_I(inode)->i_file_acl, 0)) {
+ if (!ext2_data_block_valid(sbi, EXT2_I(inode)->i_file_acl, 1)) {
ext2_error(inode->i_sb, "ext2_xattr_delete_inode",
"inode %ld: xattr block %d is out of data blocks range",
inode->i_ino, EXT2_I(inode)->i_file_acl);