diff options
author | Jeff Layton <jlayton@redhat.com> | 2014-03-26 10:24:23 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2014-04-24 23:37:03 -0400 |
commit | a87c9ad956676d84d459739fc14ec5a3c3565717 (patch) | |
tree | 5e5da8ae521dc675775ee65f0964121a5d752d26 /fs/cifs/inode.c | |
parent | 76429f1dedbc1815d875c9b68eefd30c95cb8fa9 (diff) |
cifs: fix actimeo=0 corner case when cifs_i->time == jiffies
actimeo=0 is supposed to be a special case that ensures that inode
attributes are always refetched from the server instead of trusting the
cache. The cifs code however uses time_in_range() to determine whether
the attributes have timed out. In the case where cifs_i->time equals
jiffies, this leads to the cifs code not refetching the inode attributes
when it should.
Fix this by explicitly testing for actimeo=0, and handling it as a
special case.
Reported-and-tested-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r-- | fs/cifs/inode.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index aadc2b68678b..a22d667f1069 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -1737,6 +1737,9 @@ cifs_inode_needs_reval(struct inode *inode) | |||
1737 | if (cifs_i->time == 0) | 1737 | if (cifs_i->time == 0) |
1738 | return true; | 1738 | return true; |
1739 | 1739 | ||
1740 | if (!cifs_sb->actimeo) | ||
1741 | return true; | ||
1742 | |||
1740 | if (!time_in_range(jiffies, cifs_i->time, | 1743 | if (!time_in_range(jiffies, cifs_i->time, |
1741 | cifs_i->time + cifs_sb->actimeo)) | 1744 | cifs_i->time + cifs_sb->actimeo)) |
1742 | return true; | 1745 | return true; |