History

untangling do_lookup() - isolate !dentry stuff from the rest of it.

Duplicate the revalidation-related parts into if (!dentry) branch. Next step will be to pull them under i_mutex. This and the next 8 commits are more or less a splitup of patch by Miklos; folks, when you are working with something that convoluted, carve your patches up into easily reviewed steps, especially when a lot of codepaths involved are rarely hit...

Al Viro committed 14 years ago

Commit 3f6c7c71 parent cda309d1 file · +16 −1Browse files

Unified · Split

fs/namei.c+16−1
@@ -1194,6 +1194,21 @@ retry: · 1193 unmodified lines
11941194 status = 1;
11951195 }
11961196 mutex_unlock(&dir->i_mutex);
1197+ if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE) && need_reval)
1198+ status = d_revalidate(dentry, nd);
1199+ if (unlikely(status <= 0)) {
1200+ if (status < 0) {
1201+ dput(dentry);
1202+ return status;
1203+ }
1204+ if (!d_invalidate(dentry)) {
1205+ dput(dentry);
1206+ dentry = NULL;
1207+ need_reval = 1;
1208+ goto retry;
1209+ }
1210+ }
1211+ goto done;
11971212 }
11981213 if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE) && need_reval)
11991214 status = d_revalidate(dentry, nd);
@@ -1209,7 +1224,7 @@ retry: · 9 unmodified lines
12091224 goto retry;
12101225 }
12111226 }
1212−
1227+done:
12131228 path->mnt = mnt;
12141229 path->dentry = dentry;
12151230 err = follow_managed(path, nd->flags);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t