Skip to content
Snippets Groups Projects
Commit 54028ab8 authored by Yury Umanets's avatar Yury Umanets
Browse files

- more fixes and comments about intent managing in ll_revalidate_it(). In few...

- more fixes and comments about intent managing in ll_revalidate_it(). In few words, in the cases dentry is valid and no lookup will be called anymore, intent may be released by ll_intent_release() with clobering -._magic, ->it_op, etc, as it will not be used anymore. In the case revalidate failed, intent should not clobber ->magic, as it will confuse ll_frob_intent() called from ll_lookup_it(). Instead ll_drop_intent_lock() and ll_intent_free() should be used.

- in the case we found potential GNS dentry we do not cause GNS mountining by returning 0 from revalidate if GNS is disabled. This fixes possible NFS stales in some cases.
parent e4cdf229
No related branches found
No related tags found
No related merge requests found
...@@ -510,9 +510,24 @@ out: ...@@ -510,9 +510,24 @@ out:
} }
if (rc == 0) { if (rc == 0) {
if (it == &lookup_it) if (it == &lookup_it) {
/*
* releasing intent with cloberring ->magic etc. as this
* is our @lookup_it which will not be used out of this
* function. --umka
*/
ll_intent_release(it); ll_intent_release(it);
} else {
/*
* as dentry is not revalidated, ll_llokup_it() me be
* called. Thus we should make sure that lock is dropped
* and intent freed without clobbering ->magic, etc. We
* free intent allocated in ll__frob_intent() called in
* this function. --umka
*/
ll_intent_drop_lock(it);
ll_intent_free(it);
}
ll_unhash_aliases(de->d_inode); ll_unhash_aliases(de->d_inode);
return 0; return 0;
} }
...@@ -524,7 +539,7 @@ out: ...@@ -524,7 +539,7 @@ out:
* lookup control path, which is always made with parent's i_sem taken. * lookup control path, which is always made with parent's i_sem taken.
* --umka * --umka
*/ */
if (rc && if (rc && atomic_read(&ll_i2sbi(de->d_inode)->ll_gns_enabled) &&
!(!((de->d_inode->i_mode & S_ISUID) && S_ISDIR(de->d_inode->i_mode)) || !(!((de->d_inode->i_mode & S_ISUID) && S_ISDIR(de->d_inode->i_mode)) ||
!(flags & LOOKUP_CONTINUE || (gns_it & (IT_CHDIR | IT_OPEN))))) { !(flags & LOOKUP_CONTINUE || (gns_it & (IT_CHDIR | IT_OPEN))))) {
/* /*
...@@ -534,7 +549,7 @@ out: ...@@ -534,7 +549,7 @@ out:
if (!ll_special_name(de)) { if (!ll_special_name(de)) {
/* /*
* releasing intent for lookup case as @it in this time * releasing intent for lookup case as @it in this time
* our private it and will not be used anymore in thois * our private it and will not be used anymore in this
* control path. --umka * control path. --umka
*/ */
if (it == &lookup_it) { if (it == &lookup_it) {
...@@ -563,9 +578,11 @@ out: ...@@ -563,9 +578,11 @@ out:
de->d_flags &= ~DCACHE_LUSTRE_INVALID; de->d_flags &= ~DCACHE_LUSTRE_INVALID;
/* /*
* this should be released with no check for @lookup_it. In the case it * here @it should be released in both cases, as in the case @it is not
* is not @lookup_it we're freeing LUSTRE_IT(it) where @it passed to us * @lookup_it we release intent allocated in ll_frob_intent(). Here we
* and allocated in ll_frob_intent(). --umka * can use ll_intent_release() which also clobers ->magic as dentry is
* revalidated and this intent will not be passed to ll_lookup_it() and
* will not confuse it. --umka
*/ */
ll_intent_release(it); ll_intent_release(it);
return rc; return rc;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment