提交 685d16dd 编写于 作者: M Miklos Szeredi 提交者: Linus Torvalds

[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: NMiklos Szeredi <miklos@szeredi.hu>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 25d7dfda
...@@ -25,8 +25,11 @@ ...@@ -25,8 +25,11 @@
*/ */
static unsigned long time_to_jiffies(unsigned long sec, unsigned long nsec) static unsigned long time_to_jiffies(unsigned long sec, unsigned long nsec)
{ {
struct timespec ts = {sec, nsec}; if (sec || nsec) {
return jiffies + timespec_to_jiffies(&ts); struct timespec ts = {sec, nsec};
return jiffies + timespec_to_jiffies(&ts);
} else
return jiffies - 1;
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册