[PATCH 1/5] fuse: fix zero timeout

From: Miklos Szeredi
Date: Thu Jul 27 2006 - 08:55:21 EST


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@xxxxxxxxxx>
---

Index: linux/fs/fuse/dir.c
===================================================================
--- linux.orig/fs/fuse/dir.c 2006-07-27 14:35:15.000000000 +0200
+++ linux/fs/fuse/dir.c 2006-07-27 14:37:59.000000000 +0200
@@ -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;
}

/*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/