Patch "fs: sysv: Fix sysv_nblocks() returns wrong value" has been added to the 4.14-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    fs: sysv: Fix sysv_nblocks() returns wrong value

to the 4.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     fs-sysv-fix-sysv_nblocks-returns-wrong-value.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 7a4df0d630193f267410c31bd4a2215a9a5a2553
Author: Chen Zhongjin <chenzhongjin@xxxxxxxxxx>
Date:   Fri Dec 9 18:04:48 2022 +0800

    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@xxxxxxxxxx>
    Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/sysv/itree.c b/fs/sysv/itree.c
index bcb67b0cabe7..31f66053e239 100644
--- a/fs/sysv/itree.c
+++ b/fs/sysv/itree.c
@@ -438,7 +438,7 @@ static unsigned sysv_nblocks(struct super_block *s, loff_t size)
 		res += blocks;
 		direct = 1;
 	}
-	return blocks;
+	return res;
 }
 
 int sysv_getattr(const struct path *path, struct kstat *stat,



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux