Skip to content

Commit

Permalink
vfs: make listxattr retry once on ESTALE error
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Layton <[email protected]>
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
jtlayton authored and Al Viro committed Dec 20, 2012
1 parent 3a3e159 commit 10a90cf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions fs/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,12 +576,17 @@ SYSCALL_DEFINE3(listxattr, const char __user *, pathname, char __user *, list,
{
struct path path;
ssize_t error;

error = user_path(pathname, &path);
unsigned int lookup_flags = LOOKUP_FOLLOW;
retry:
error = user_path_at(AT_FDCWD, pathname, lookup_flags, &path);
if (error)
return error;
error = listxattr(path.dentry, list, size);
path_put(&path);
if (retry_estale(error, lookup_flags)) {
lookup_flags |= LOOKUP_REVAL;
goto retry;
}
return error;
}

Expand Down

0 comments on commit 10a90cf

Please sign in to comment.