aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Brandenburg <martin@omnibond.com>2016-07-28 14:46:36 -0400
committerMartin Brandenburg <martin@omnibond.com>2016-08-02 15:39:13 -0400
commit8bbb20a863ca72dfb9025a4653f21b5abf926d20 (patch)
treed4fd9ecb8da7f69ca9e474e003cb2896808121ef
parent957ee43718c5a226fa70ef5e680d037ca9156af6 (diff)
orangefs: Account for jiffies wraparound.
Signed-off-by: Martin Brandenburg <martin@omnibond.com>
-rw-r--r--fs/orangefs/dcache.c2
-rw-r--r--fs/orangefs/namei.c10
-rw-r--r--fs/orangefs/orangefs-utils.c4
3 files changed, 8 insertions, 8 deletions
diff --git a/fs/orangefs/dcache.c b/fs/orangefs/dcache.c
index 2521af6707f7..00235bf644dc 100644
--- a/fs/orangefs/dcache.c
+++ b/fs/orangefs/dcache.c
@@ -95,7 +95,7 @@ static int orangefs_d_revalidate(struct dentry *dentry, unsigned int flags)
95{ 95{
96 int ret; 96 int ret;
97 97
98 if (dentry->d_time > jiffies) 98 if (time_before(jiffies, dentry->d_time))
99 return 1; 99 return 1;
100 100
101 if (flags & LOOKUP_RCU) 101 if (flags & LOOKUP_RCU)
diff --git a/fs/orangefs/namei.c b/fs/orangefs/namei.c
index 77071b78816a..62c525936ee8 100644
--- a/fs/orangefs/namei.c
+++ b/fs/orangefs/namei.c
@@ -73,7 +73,7 @@ static int orangefs_create(struct inode *dir,
73 d_instantiate(dentry, inode); 73 d_instantiate(dentry, inode);
74 unlock_new_inode(inode); 74 unlock_new_inode(inode);
75 dentry->d_time = jiffies + dcache_timeout_msecs*HZ/1000; 75 dentry->d_time = jiffies + dcache_timeout_msecs*HZ/1000;
76 ORANGEFS_I(inode)->getattr_time = 0; 76 ORANGEFS_I(inode)->getattr_time = jiffies - 1;
77 77
78 gossip_debug(GOSSIP_NAME_DEBUG, 78 gossip_debug(GOSSIP_NAME_DEBUG,
79 "%s: dentry instantiated for %s\n", 79 "%s: dentry instantiated for %s\n",
@@ -193,7 +193,7 @@ static struct dentry *orangefs_lookup(struct inode *dir, struct dentry *dentry,
193 goto out; 193 goto out;
194 } 194 }
195 195
196 ORANGEFS_I(inode)->getattr_time = 0; 196 ORANGEFS_I(inode)->getattr_time = jiffies - 1;
197 197
198 gossip_debug(GOSSIP_NAME_DEBUG, 198 gossip_debug(GOSSIP_NAME_DEBUG,
199 "%s:%s:%d " 199 "%s:%s:%d "
@@ -323,7 +323,7 @@ static int orangefs_symlink(struct inode *dir,
323 d_instantiate(dentry, inode); 323 d_instantiate(dentry, inode);
324 unlock_new_inode(inode); 324 unlock_new_inode(inode);
325 dentry->d_time = jiffies + dcache_timeout_msecs*HZ/1000; 325 dentry->d_time = jiffies + dcache_timeout_msecs*HZ/1000;
326 ORANGEFS_I(inode)->getattr_time = 0; 326 ORANGEFS_I(inode)->getattr_time = jiffies - 1;
327 327
328 gossip_debug(GOSSIP_NAME_DEBUG, 328 gossip_debug(GOSSIP_NAME_DEBUG,
329 "Inode (Symlink) %pU -> %s\n", 329 "Inode (Symlink) %pU -> %s\n",
@@ -387,7 +387,7 @@ static int orangefs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode
387 d_instantiate(dentry, inode); 387 d_instantiate(dentry, inode);
388 unlock_new_inode(inode); 388 unlock_new_inode(inode);
389 dentry->d_time = jiffies + dcache_timeout_msecs*HZ/1000; 389 dentry->d_time = jiffies + dcache_timeout_msecs*HZ/1000;
390 ORANGEFS_I(inode)->getattr_time = 0; 390 ORANGEFS_I(inode)->getattr_time = jiffies - 1;
391 391
392 gossip_debug(GOSSIP_NAME_DEBUG, 392 gossip_debug(GOSSIP_NAME_DEBUG,
393 "Inode (Directory) %pU -> %s\n", 393 "Inode (Directory) %pU -> %s\n",
@@ -418,7 +418,7 @@ static int orangefs_rename(struct inode *old_dir,
418 "orangefs_rename: called (%pd2 => %pd2) ct=%d\n", 418 "orangefs_rename: called (%pd2 => %pd2) ct=%d\n",
419 old_dentry, new_dentry, d_count(new_dentry)); 419 old_dentry, new_dentry, d_count(new_dentry));
420 420
421 ORANGEFS_I(new_dentry->d_parent->d_inode)->getattr_time = 0; 421 ORANGEFS_I(new_dentry->d_parent->d_inode)->getattr_time = jiffies - 1;
422 422
423 new_op = op_alloc(ORANGEFS_VFS_OP_RENAME); 423 new_op = op_alloc(ORANGEFS_VFS_OP_RENAME);
424 if (!new_op) 424 if (!new_op)
diff --git a/fs/orangefs/orangefs-utils.c b/fs/orangefs/orangefs-utils.c
index cd512a3a9c52..d13c7291fd05 100644
--- a/fs/orangefs/orangefs-utils.c
+++ b/fs/orangefs/orangefs-utils.c
@@ -262,7 +262,7 @@ int orangefs_inode_getattr(struct inode *inode, int new, int bypass)
262 get_khandle_from_ino(inode)); 262 get_khandle_from_ino(inode));
263 263
264 if (!new && !bypass) { 264 if (!new && !bypass) {
265 if (orangefs_inode->getattr_time > jiffies) 265 if (time_before(jiffies, orangefs_inode->getattr_time))
266 return 0; 266 return 0;
267 } 267 }
268 268
@@ -421,7 +421,7 @@ int orangefs_inode_setattr(struct inode *inode, struct iattr *iattr)
421 ClearMtimeFlag(orangefs_inode); 421 ClearMtimeFlag(orangefs_inode);
422 ClearCtimeFlag(orangefs_inode); 422 ClearCtimeFlag(orangefs_inode);
423 ClearModeFlag(orangefs_inode); 423 ClearModeFlag(orangefs_inode);
424 orangefs_inode->getattr_time = 0; 424 orangefs_inode->getattr_time = jiffies - 1;
425 } 425 }
426 426
427 return ret; 427 return ret;