Skip to contentSkip to conversation

Patch "fuse: fix time_to_jiffies nsec sanity check" has been added to the 4.9-stable tree

PATCH [email protected] 1 participant 1 message Jan 23, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

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

fuse: fix time_to_jiffies nsec sanity check

to the 4.9-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:
fuse-fix-time_to_jiffies-nsec-sanity-check.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 210675270caa33253e4c33f3c5e657e7d6060812 Mon Sep 17 00:00:00 2001

From: David Sheets <[email protected]>
Date: Fri, 13 Jan 2017 15:58:30 +0000
Subject: fuse: fix time_to_jiffies nsec sanity check

From: David Sheets <[email protected]>

commit 210675270caa33253e4c33f3c5e657e7d6060812 upstream.

Commit bcb6f6d2b9c2 ("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 bcb6f6d2b9c2 ("fuse: use timespec64")
---
 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
 	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);

Patches currently in stable-queue which might be from [email protected] are

queue-4.9/fuse-fix-time_to_jiffies-nsec-sanity-check.patch