Commit 8bbb20a8 authored by Martin Brandenburg's avatar Martin Brandenburg

orangefs: Account for jiffies wraparound.

Signed-off-by: default avatarMartin Brandenburg <martin@omnibond.com>
parent 957ee437
...@@ -95,7 +95,7 @@ static int orangefs_d_revalidate(struct dentry *dentry, unsigned int flags) ...@@ -95,7 +95,7 @@ static int orangefs_d_revalidate(struct dentry *dentry, unsigned int flags)
{ {
int ret; int ret;
if (dentry->d_time > jiffies) if (time_before(jiffies, dentry->d_time))
return 1; return 1;
if (flags & LOOKUP_RCU) if (flags & LOOKUP_RCU)
......
...@@ -73,7 +73,7 @@ static int orangefs_create(struct inode *dir, ...@@ -73,7 +73,7 @@ static int orangefs_create(struct inode *dir,
d_instantiate(dentry, inode); d_instantiate(dentry, inode);
unlock_new_inode(inode); unlock_new_inode(inode);
dentry->d_time = jiffies + dcache_timeout_msecs*HZ/1000; dentry->d_time = jiffies + dcache_timeout_msecs*HZ/1000;
ORANGEFS_I(inode)->getattr_time = 0; ORANGEFS_I(inode)->getattr_time = jiffies - 1;
gossip_debug(GOSSIP_NAME_DEBUG, gossip_debug(GOSSIP_NAME_DEBUG,
"%s: dentry instantiated for %s\n", "%s: dentry instantiated for %s\n",
...@@ -193,7 +193,7 @@ static struct dentry *orangefs_lookup(struct inode *dir, struct dentry *dentry, ...@@ -193,7 +193,7 @@ static struct dentry *orangefs_lookup(struct inode *dir, struct dentry *dentry,
goto out; goto out;
} }
ORANGEFS_I(inode)->getattr_time = 0; ORANGEFS_I(inode)->getattr_time = jiffies - 1;
gossip_debug(GOSSIP_NAME_DEBUG, gossip_debug(GOSSIP_NAME_DEBUG,
"%s:%s:%d " "%s:%s:%d "
...@@ -323,7 +323,7 @@ static int orangefs_symlink(struct inode *dir, ...@@ -323,7 +323,7 @@ static int orangefs_symlink(struct inode *dir,
d_instantiate(dentry, inode); d_instantiate(dentry, inode);
unlock_new_inode(inode); unlock_new_inode(inode);
dentry->d_time = jiffies + dcache_timeout_msecs*HZ/1000; dentry->d_time = jiffies + dcache_timeout_msecs*HZ/1000;
ORANGEFS_I(inode)->getattr_time = 0; ORANGEFS_I(inode)->getattr_time = jiffies - 1;
gossip_debug(GOSSIP_NAME_DEBUG, gossip_debug(GOSSIP_NAME_DEBUG,
"Inode (Symlink) %pU -> %s\n", "Inode (Symlink) %pU -> %s\n",
...@@ -387,7 +387,7 @@ static int orangefs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode ...@@ -387,7 +387,7 @@ static int orangefs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode
d_instantiate(dentry, inode); d_instantiate(dentry, inode);
unlock_new_inode(inode); unlock_new_inode(inode);
dentry->d_time = jiffies + dcache_timeout_msecs*HZ/1000; dentry->d_time = jiffies + dcache_timeout_msecs*HZ/1000;
ORANGEFS_I(inode)->getattr_time = 0; ORANGEFS_I(inode)->getattr_time = jiffies - 1;
gossip_debug(GOSSIP_NAME_DEBUG, gossip_debug(GOSSIP_NAME_DEBUG,
"Inode (Directory) %pU -> %s\n", "Inode (Directory) %pU -> %s\n",
...@@ -418,7 +418,7 @@ static int orangefs_rename(struct inode *old_dir, ...@@ -418,7 +418,7 @@ static int orangefs_rename(struct inode *old_dir,
"orangefs_rename: called (%pd2 => %pd2) ct=%d\n", "orangefs_rename: called (%pd2 => %pd2) ct=%d\n",
old_dentry, new_dentry, d_count(new_dentry)); old_dentry, new_dentry, d_count(new_dentry));
ORANGEFS_I(new_dentry->d_parent->d_inode)->getattr_time = 0; ORANGEFS_I(new_dentry->d_parent->d_inode)->getattr_time = jiffies - 1;
new_op = op_alloc(ORANGEFS_VFS_OP_RENAME); new_op = op_alloc(ORANGEFS_VFS_OP_RENAME);
if (!new_op) if (!new_op)
......
...@@ -262,7 +262,7 @@ int orangefs_inode_getattr(struct inode *inode, int new, int bypass) ...@@ -262,7 +262,7 @@ int orangefs_inode_getattr(struct inode *inode, int new, int bypass)
get_khandle_from_ino(inode)); get_khandle_from_ino(inode));
if (!new && !bypass) { if (!new && !bypass) {
if (orangefs_inode->getattr_time > jiffies) if (time_before(jiffies, orangefs_inode->getattr_time))
return 0; return 0;
} }
...@@ -421,7 +421,7 @@ int orangefs_inode_setattr(struct inode *inode, struct iattr *iattr) ...@@ -421,7 +421,7 @@ int orangefs_inode_setattr(struct inode *inode, struct iattr *iattr)
ClearMtimeFlag(orangefs_inode); ClearMtimeFlag(orangefs_inode);
ClearCtimeFlag(orangefs_inode); ClearCtimeFlag(orangefs_inode);
ClearModeFlag(orangefs_inode); ClearModeFlag(orangefs_inode);
orangefs_inode->getattr_time = 0; orangefs_inode->getattr_time = jiffies - 1;
} }
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment