diff options
-rw-r--r-- | fs/namei.c | 11 | ||||
-rw-r--r-- | include/linux/namei.h | 1 |
2 files changed, 3 insertions, 9 deletions
diff --git a/fs/namei.c b/fs/namei.c index 5e65f67ee926..f49d6abfa799 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -664,7 +664,7 @@ static int follow_automount(struct path *path, unsigned flags, | |||
664 | /* We don't want to mount if someone supplied AT_NO_AUTOMOUNT | 664 | /* We don't want to mount if someone supplied AT_NO_AUTOMOUNT |
665 | * and this is the terminal part of the path. | 665 | * and this is the terminal part of the path. |
666 | */ | 666 | */ |
667 | if ((flags & LOOKUP_NO_AUTOMOUNT) && !(flags & LOOKUP_CONTINUE)) | 667 | if ((flags & LOOKUP_NO_AUTOMOUNT) && !(flags & LOOKUP_PARENT)) |
668 | return -EISDIR; /* we actually want to stop here */ | 668 | return -EISDIR; /* we actually want to stop here */ |
669 | 669 | ||
670 | /* We want to mount if someone is trying to open/create a file of any | 670 | /* We want to mount if someone is trying to open/create a file of any |
@@ -676,7 +676,7 @@ static int follow_automount(struct path *path, unsigned flags, | |||
676 | * appended a '/' to the name. | 676 | * appended a '/' to the name. |
677 | */ | 677 | */ |
678 | if (!(flags & LOOKUP_FOLLOW) && | 678 | if (!(flags & LOOKUP_FOLLOW) && |
679 | !(flags & (LOOKUP_CONTINUE | LOOKUP_DIRECTORY | | 679 | !(flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY | |
680 | LOOKUP_OPEN | LOOKUP_CREATE))) | 680 | LOOKUP_OPEN | LOOKUP_CREATE))) |
681 | return -EISDIR; | 681 | return -EISDIR; |
682 | 682 | ||
@@ -695,7 +695,7 @@ static int follow_automount(struct path *path, unsigned flags, | |||
695 | * the path being looked up; if it wasn't then the remainder of | 695 | * the path being looked up; if it wasn't then the remainder of |
696 | * the path is inaccessible and we should say so. | 696 | * the path is inaccessible and we should say so. |
697 | */ | 697 | */ |
698 | if (PTR_ERR(mnt) == -EISDIR && (flags & LOOKUP_CONTINUE)) | 698 | if (PTR_ERR(mnt) == -EISDIR && (flags & LOOKUP_PARENT)) |
699 | return -EREMOTE; | 699 | return -EREMOTE; |
700 | return PTR_ERR(mnt); | 700 | return PTR_ERR(mnt); |
701 | } | 701 | } |
@@ -1281,7 +1281,6 @@ static int link_path_walk(const char *name, struct nameidata *nd) | |||
1281 | { | 1281 | { |
1282 | struct path next; | 1282 | struct path next; |
1283 | int err; | 1283 | int err; |
1284 | unsigned int lookup_flags = nd->flags; | ||
1285 | 1284 | ||
1286 | while (*name=='/') | 1285 | while (*name=='/') |
1287 | name++; | 1286 | name++; |
@@ -1295,8 +1294,6 @@ static int link_path_walk(const char *name, struct nameidata *nd) | |||
1295 | unsigned int c; | 1294 | unsigned int c; |
1296 | int type; | 1295 | int type; |
1297 | 1296 | ||
1298 | nd->flags |= LOOKUP_CONTINUE; | ||
1299 | |||
1300 | err = may_lookup(nd); | 1297 | err = may_lookup(nd); |
1301 | if (err) | 1298 | if (err) |
1302 | break; | 1299 | break; |
@@ -1358,8 +1355,6 @@ static int link_path_walk(const char *name, struct nameidata *nd) | |||
1358 | /* here ends the main loop */ | 1355 | /* here ends the main loop */ |
1359 | 1356 | ||
1360 | last_component: | 1357 | last_component: |
1361 | /* Clear LOOKUP_CONTINUE iff it was previously unset */ | ||
1362 | nd->flags &= lookup_flags | ~LOOKUP_CONTINUE; | ||
1363 | nd->last = this; | 1358 | nd->last = this; |
1364 | nd->last_type = type; | 1359 | nd->last_type = type; |
1365 | return 0; | 1360 | return 0; |
diff --git a/include/linux/namei.h b/include/linux/namei.h index eba45ea10298..3439ab862e1d 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -48,7 +48,6 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND}; | |||
48 | */ | 48 | */ |
49 | #define LOOKUP_FOLLOW 0x0001 | 49 | #define LOOKUP_FOLLOW 0x0001 |
50 | #define LOOKUP_DIRECTORY 0x0002 | 50 | #define LOOKUP_DIRECTORY 0x0002 |
51 | #define LOOKUP_CONTINUE 0x0004 | ||
52 | 51 | ||
53 | #define LOOKUP_PARENT 0x0010 | 52 | #define LOOKUP_PARENT 0x0010 |
54 | #define LOOKUP_REVAL 0x0020 | 53 | #define LOOKUP_REVAL 0x0020 |