Commit 685d16ddb07b74537fb18972784e6214840fdd20

Authored by Miklos Szeredi
Committed by Linus Torvalds
1 parent 25d7dfdaf3

[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>

Showing 1 changed file with 5 additions and 2 deletions Side-by-side Diff

... ... @@ -25,8 +25,11 @@
25 25 */
26 26 static unsigned long time_to_jiffies(unsigned long sec, unsigned long nsec)
27 27 {
28   - struct timespec ts = {sec, nsec};
29   - return jiffies + timespec_to_jiffies(&ts);
  28 + if (sec || nsec) {
  29 + struct timespec ts = {sec, nsec};
  30 + return jiffies + timespec_to_jiffies(&ts);
  31 + } else
  32 + return jiffies - 1;
30 33 }
31 34  
32 35 /*