diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/namei.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/fs/namei.c b/fs/namei.c index ec4b2d0190a8..9ce6d272f4f2 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -668,9 +668,6 @@ force_reval_path(struct path *path, struct nameidata *nd) | |||
668 | return 0; | 668 | return 0; |
669 | 669 | ||
670 | if (!status) { | 670 | if (!status) { |
671 | /* Don't d_invalidate in rcu-walk mode */ | ||
672 | if (nameidata_drop_rcu(nd)) | ||
673 | return -ECHILD; | ||
674 | d_invalidate(dentry); | 671 | d_invalidate(dentry); |
675 | status = -ESTALE; | 672 | status = -ESTALE; |
676 | } | 673 | } |
@@ -777,6 +774,8 @@ __do_follow_link(const struct path *link, struct nameidata *nd, void **p) | |||
777 | int error; | 774 | int error; |
778 | struct dentry *dentry = link->dentry; | 775 | struct dentry *dentry = link->dentry; |
779 | 776 | ||
777 | BUG_ON(nd->flags & LOOKUP_RCU); | ||
778 | |||
780 | touch_atime(link->mnt, dentry); | 779 | touch_atime(link->mnt, dentry); |
781 | nd_set_link(nd, NULL); | 780 | nd_set_link(nd, NULL); |
782 | 781 | ||
@@ -811,6 +810,11 @@ static inline int do_follow_link(struct path *path, struct nameidata *nd) | |||
811 | { | 810 | { |
812 | void *cookie; | 811 | void *cookie; |
813 | int err = -ELOOP; | 812 | int err = -ELOOP; |
813 | |||
814 | /* We drop rcu-walk here */ | ||
815 | if (nameidata_dentry_drop_rcu_maybe(nd, path->dentry)) | ||
816 | return -ECHILD; | ||
817 | |||
814 | if (current->link_count >= MAX_NESTED_LINKS) | 818 | if (current->link_count >= MAX_NESTED_LINKS) |
815 | goto loop; | 819 | goto loop; |
816 | if (current->total_link_count >= 40) | 820 | if (current->total_link_count >= 40) |
@@ -1419,9 +1423,6 @@ exec_again: | |||
1419 | goto out_dput; | 1423 | goto out_dput; |
1420 | 1424 | ||
1421 | if (inode->i_op->follow_link) { | 1425 | if (inode->i_op->follow_link) { |
1422 | /* We commonly drop rcu-walk here */ | ||
1423 | if (nameidata_dentry_drop_rcu_maybe(nd, next.dentry)) | ||
1424 | return -ECHILD; | ||
1425 | BUG_ON(inode != next.dentry->d_inode); | 1426 | BUG_ON(inode != next.dentry->d_inode); |
1426 | err = do_follow_link(&next, nd); | 1427 | err = do_follow_link(&next, nd); |
1427 | if (err) | 1428 | if (err) |
@@ -1467,8 +1468,6 @@ last_component: | |||
1467 | break; | 1468 | break; |
1468 | if (inode && unlikely(inode->i_op->follow_link) && | 1469 | if (inode && unlikely(inode->i_op->follow_link) && |
1469 | (lookup_flags & LOOKUP_FOLLOW)) { | 1470 | (lookup_flags & LOOKUP_FOLLOW)) { |
1470 | if (nameidata_dentry_drop_rcu_maybe(nd, next.dentry)) | ||
1471 | return -ECHILD; | ||
1472 | BUG_ON(inode != next.dentry->d_inode); | 1471 | BUG_ON(inode != next.dentry->d_inode); |
1473 | err = do_follow_link(&next, nd); | 1472 | err = do_follow_link(&next, nd); |
1474 | if (err) | 1473 | if (err) |