projects/linux·commit 685d16dd

[PATCH] fuse: fix zero timeout

685d16dd · Miklos Szeredi <[email protected]> · 2006-07-30 03:04:08 -07:00

An attribute and entry timeout of zero should mean, that the entity is
invalidated immediately after the operation.  Previously invalidation only
happened at the next clock tick.

Reported and tested by Craig Davies.

Signed-off-by: Miklos Szeredi <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
685d16ddb07b74537fb18972784e6214840fdd20
Parents
25d7dfda

Changes

1 files changed · +5 −2

FileStatusAddDelContent
fs/fuse/dir.cmodified+5−2View file

fs/fuse/dir.c

View file
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 72a74cd..6db66ec 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -25,8 +25,11 @@
*/
static unsigned long time_to_jiffies(unsigned long sec, unsigned long nsec)
{
- struct timespec ts = {sec, nsec};
- return jiffies + timespec_to_jiffies(&ts);
+ if (sec || nsec) {
+ struct timespec ts = {sec, nsec};
+ return jiffies + timespec_to_jiffies(&ts);
+ } else
+ return jiffies - 1;
}
/*