Skip to content

Commit

Permalink
[PATCH] fuse: fix zero timeout
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
szmi authored and Linus Torvalds committed Jul 31, 2006
1 parent 25d7dfd commit 685d16d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fs/fuse/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/*
Expand Down

0 comments on commit 685d16d

Please sign in to comment.