Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

do_sys_truncate(): switch to CLASS(filename)

Note that failures from filename_lookup() are final - ESTALE returned
by it means that retry had been done by filename_lookup() and it failed
there.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 97ed55d2 7273ed4e

+5 -7
+5 -7
fs/open.c
··· 129 129 int do_sys_truncate(const char __user *pathname, loff_t length) 130 130 { 131 131 unsigned int lookup_flags = LOOKUP_FOLLOW; 132 - struct filename *name; 133 132 struct path path; 134 133 int error; 135 134 136 135 if (length < 0) /* sorry, but loff_t says... */ 137 136 return -EINVAL; 138 137 139 - name = getname(pathname); 138 + CLASS(filename, name)(pathname); 140 139 retry: 141 140 error = filename_lookup(AT_FDCWD, name, lookup_flags, &path, NULL); 142 141 if (!error) { 143 142 error = vfs_truncate(&path, length); 144 143 path_put(&path); 144 + if (retry_estale(error, lookup_flags)) { 145 + lookup_flags |= LOOKUP_REVAL; 146 + goto retry; 147 + } 145 148 } 146 - if (retry_estale(error, lookup_flags)) { 147 - lookup_flags |= LOOKUP_REVAL; 148 - goto retry; 149 - } 150 - putname(name); 151 149 return error; 152 150 } 153 151