mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
fuse: fix time_to_jiffies nsec sanity check
Commitbcb6f6d2b9
("fuse: use timespec64") 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. Fixes:bcb6f6d2b9
("fuse: use timespec64") Signed-off-by: David Sheets <dsheets@docker.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Cc: <stable@vger.kernel.org> # 4.9
This commit is contained in:
parent
a8a86d78d6
commit
210675270c
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user