Skip to content

Commit 337b68d

Browse files
Chen Zhongjingregkh
authored andcommitted
fs: sysv: Fix sysv_nblocks() returns wrong value
[ Upstream commit e0c49bd ] sysv_nblocks() returns 'blocks' rather than 'res', which only counting the number of triple-indirect blocks and causing sysv_getattr() gets a wrong result. [AV: this is actually a sysv counterpart of minixfs fix - 0fcd426de9d0 "[PATCH] minix block usage counting fix" in historical tree; mea culpa, should've thought to check fs/sysv back then...] Fixes: 1da177e ("Linux-2.6.12-rc2") Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 95d42a8 commit 337b68d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/sysv/itree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ static unsigned sysv_nblocks(struct super_block *s, loff_t size)
438438
res += blocks;
439439
direct = 1;
440440
}
441-
return blocks;
441+
return res;
442442
}
443443

444444
int sysv_getattr(struct user_namespace *mnt_userns, const struct path *path,

0 commit comments

Comments
 (0)