summaryrefslogtreecommitdiffstats
path: root/fs/fuse
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2006-07-30 03:04:08 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-31 13:28:43 -0700
commit685d16ddb07b74537fb18972784e6214840fdd20 (patch)
treef9a0825348629824f7867270c5860edb02e91e75 /fs/fuse
parent25d7dfdaf3404bb31b8f55283fd2c456cb7b4001 (diff)
downloadlinux-stable-685d16ddb07b74537fb18972784e6214840fdd20.tar.gz
linux-stable-685d16ddb07b74537fb18972784e6214840fdd20.tar.bz2
linux-stable-685d16ddb07b74537fb18972784e6214840fdd20.zip
[PATCH] fuse: fix zero timeout
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 <miklos@szeredi.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/fuse')
-rw-r--r--fs/fuse/dir.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 72a74cde6de8..6db66ec386ae 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;
}
/*