fuse: fix time_to_jiffies nsec sanity check
Subsystems (2)
PATCH 1/1 fuse: fix time_to_jiffies nsec sanity check
bcb6f6d2b9c299db32b20f4357c36a101e7f0293 introduced clamped nsec values in time_to_jiffies but used the max of nsec and NSEC_PER_SEC - 1 instead of the min. Because of this, dentries would stay in the cache longer than requested and go stale in scenarios that relied on their timely eviction.
Signed-off-by David Sheets <[email protected]>
--- fs/fuse/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/fuse/dir.c +1 -1
@@ -68,7 +68,7 @@ static u64 time_to_jiffies(u64 sec, u32 nsec)if (sec || nsec) {struct timespec64 ts = { sec, -max_t (u32, nsec,NSEC_PER_SEC -1 ) +min_t (u32, nsec,NSEC_PER_SEC -1 ) };return get_jiffies_64 () +timespec64_to_jiffies (&ts);
Signature · 1 line
2.7.1
Quoted 5 lines · David Sheets
bcb6f6d2b9c299db32b20f4357c36a101e7f0293introduced clamped nsec values intime_to_jiffiesbut used the max of nsec andNSEC_PER_SEC- 1 instead of the min. Because of this, dentries would stay in the cache longer than requested and go stale in scenarios that relied on their timely eviction.
Thanks, applied.
Miklos