diff options
-rw-r--r-- | fs/namei.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/fs/namei.c b/fs/namei.c index 976fc323272e..84f1ec3b4a5d 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -1873,7 +1873,7 @@ exit_parent: | |||
1873 | 1873 | ||
1874 | do_link: | 1874 | do_link: |
1875 | error = -ELOOP; | 1875 | error = -ELOOP; |
1876 | if (flag & O_NOFOLLOW) | 1876 | if ((flag & O_NOFOLLOW) || count++ == 32) |
1877 | goto exit_dput; | 1877 | goto exit_dput; |
1878 | /* | 1878 | /* |
1879 | * This is subtle. Instead of calling do_follow_link() we do the | 1879 | * This is subtle. Instead of calling do_follow_link() we do the |
@@ -1915,11 +1915,6 @@ do_link: | |||
1915 | __putname(nd.last.name); | 1915 | __putname(nd.last.name); |
1916 | goto exit; | 1916 | goto exit; |
1917 | } | 1917 | } |
1918 | error = -ELOOP; | ||
1919 | if (count++==32) { | ||
1920 | __putname(nd.last.name); | ||
1921 | goto exit; | ||
1922 | } | ||
1923 | filp = do_last(&nd, &path, open_flag, flag, acc_mode, mode, | 1918 | filp = do_last(&nd, &path, open_flag, flag, acc_mode, mode, |
1924 | pathname, &is_link); | 1919 | pathname, &is_link); |
1925 | __putname(nd.last.name); | 1920 | __putname(nd.last.name); |