Orangefs: don't trigger copy_attributes_to_inode from d_revalidate.
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
This commit is contained in:
@@ -77,7 +77,7 @@ out_drop:
|
|||||||
/*
|
/*
|
||||||
* Verify that dentry is valid.
|
* Verify that dentry is valid.
|
||||||
*
|
*
|
||||||
* Should return 1 if dentry can still be trusted, else 0
|
* Should return 1 if dentry can still be trusted, else 0.
|
||||||
*/
|
*/
|
||||||
static int orangefs_d_revalidate(struct dentry *dentry, unsigned int flags)
|
static int orangefs_d_revalidate(struct dentry *dentry, unsigned int flags)
|
||||||
{
|
{
|
||||||
@@ -92,49 +92,27 @@ static int orangefs_d_revalidate(struct dentry *dentry, unsigned int flags)
|
|||||||
|
|
||||||
/* find inode from dentry */
|
/* find inode from dentry */
|
||||||
if (!dentry->d_inode) {
|
if (!dentry->d_inode) {
|
||||||
gossip_debug(GOSSIP_DCACHE_DEBUG, "%s: negative dentry.\n",
|
gossip_debug(GOSSIP_DCACHE_DEBUG,
|
||||||
|
"%s: negative dentry.\n",
|
||||||
__func__);
|
__func__);
|
||||||
goto invalid_exit;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
gossip_debug(GOSSIP_DCACHE_DEBUG, "%s: inode valid.\n", __func__);
|
gossip_debug(GOSSIP_DCACHE_DEBUG, "%s: inode valid.\n", __func__);
|
||||||
inode = dentry->d_inode;
|
inode = dentry->d_inode;
|
||||||
|
|
||||||
/*
|
/* skip root handle lookups. */
|
||||||
* first perform a lookup to make sure that the object not only
|
if (is_root_handle(inode)) {
|
||||||
* exists, but is still in the expected place in the name space
|
ret = 1;
|
||||||
*/
|
goto out;
|
||||||
if (!is_root_handle(inode)) {
|
|
||||||
if (!orangefs_revalidate_lookup(dentry))
|
|
||||||
goto invalid_exit;
|
|
||||||
} else {
|
|
||||||
gossip_debug(GOSSIP_DCACHE_DEBUG,
|
|
||||||
"%s: root handle, lookup skipped.\n",
|
|
||||||
__func__);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now perform getattr */
|
/* lookup the object. */
|
||||||
gossip_debug(GOSSIP_DCACHE_DEBUG,
|
if (orangefs_revalidate_lookup(dentry))
|
||||||
"%s: doing getattr: inode: %p, handle: %pU\n",
|
ret = 1;
|
||||||
__func__,
|
|
||||||
inode,
|
|
||||||
get_khandle_from_ino(inode));
|
|
||||||
ret = orangefs_inode_getattr(inode, ORANGEFS_ATTR_SYS_ALL_NOHINT);
|
|
||||||
gossip_debug(GOSSIP_DCACHE_DEBUG,
|
|
||||||
"%s: getattr %s (ret = %d), returning %s for dentry i_count=%d\n",
|
|
||||||
__func__,
|
|
||||||
(ret == 0 ? "succeeded" : "failed"),
|
|
||||||
ret,
|
|
||||||
(ret == 0 ? "valid" : "INVALID"),
|
|
||||||
atomic_read(&inode->i_count));
|
|
||||||
if (ret != 0)
|
|
||||||
goto invalid_exit;
|
|
||||||
|
|
||||||
/* dentry is valid! */
|
out:
|
||||||
return 1;
|
return ret;
|
||||||
|
|
||||||
invalid_exit:
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct dentry_operations orangefs_dentry_operations = {
|
const struct dentry_operations orangefs_dentry_operations = {
|
||||||
|
|||||||
Reference in New Issue
Block a user