[PATCH] fuse: fix zero timeout
authorMiklos Szeredi <miklos@szeredi.hu>
Sun, 30 Jul 2006 10:04:08 +0000 (03:04 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 31 Jul 2006 20:28:43 +0000 (13:28 -0700)
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>
fs/fuse/dir.c

index 72a74cde6de8c288793293d4e4ca4bb4ea58b793..6db66ec386aef2d61873d3cacea3509a55c2741e 100644 (file)
  */
 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;
 }
 
 /*