]> git.baikalelectronics.ru Git - kernel.git/commit
fs: sysv: Fix sysv_nblocks() returns wrong value
authorChen Zhongjin <chenzhongjin@huawei.com>
Fri, 9 Dec 2022 10:04:48 +0000 (18:04 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:40:58 +0000 (11:40 +0100)
commit1646441a01f408321e798c52f4e7e2bd503857ee
tree2422d811d5e61a4e96aa1dd297baef70564ff9e7
parentb52f5e536f0abfa2deb0e7c5ce9e0d873c7000ad
fs: sysv: Fix sysv_nblocks() returns wrong value

[ Upstream commit e0c49bd2b4d3cd1751491eb2d940bce968ac65e9 ]

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: 1da177e4c3f4 ("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>
fs/sysv/itree.c