]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/namei.c
ARM: at91/dt: sama5d4ek: mci0 uses slot 0
[karo-tx-linux.git] / fs / namei.c
index 76fb76a0818bc274fc67b2d87b582db6690d62a6..4a8d998b7274b3406532cc012d05ee18aa9b5bba 100644 (file)
@@ -1585,12 +1585,13 @@ static inline int walk_component(struct nameidata *nd, struct path *path,
                inode = path->dentry->d_inode;
        }
        err = -ENOENT;
-       if (!inode || d_is_negative(path->dentry))
+       if (d_is_negative(path->dentry))
                goto out_path_put;
 
        if (should_follow_link(path->dentry, follow)) {
                if (nd->flags & LOOKUP_RCU) {
-                       if (unlikely(unlazy_walk(nd, path->dentry))) {
+                       if (unlikely(nd->path.mnt != path->mnt ||
+                                    unlazy_walk(nd, path->dentry))) {
                                err = -ECHILD;
                                goto out_err;
                        }
@@ -2310,7 +2311,7 @@ mountpoint_last(struct nameidata *nd, struct path *path)
        mutex_unlock(&dir->d_inode->i_mutex);
 
 done:
-       if (!dentry->d_inode || d_is_negative(dentry)) {
+       if (d_is_negative(dentry)) {
                error = -ENOENT;
                dput(dentry);
                goto out;
@@ -3038,14 +3039,15 @@ retry_lookup:
 finish_lookup:
        /* we _can_ be in RCU mode here */
        error = -ENOENT;
-       if (!inode || d_is_negative(path->dentry)) {
+       if (d_is_negative(path->dentry)) {
                path_to_nameidata(path, nd);
                goto out;
        }
 
        if (should_follow_link(path->dentry, !symlink_ok)) {
                if (nd->flags & LOOKUP_RCU) {
-                       if (unlikely(unlazy_walk(nd, path->dentry))) {
+                       if (unlikely(nd->path.mnt != path->mnt ||
+                                    unlazy_walk(nd, path->dentry))) {
                                error = -ECHILD;
                                goto out;
                        }
@@ -3077,7 +3079,7 @@ finish_open:
        error = -ENOTDIR;
        if ((nd->flags & LOOKUP_DIRECTORY) && !d_can_lookup(nd->path.dentry))
                goto out;
-       if (!S_ISREG(nd->inode->i_mode))
+       if (!d_is_reg(nd->path.dentry))
                will_truncate = false;
 
        if (will_truncate) {