From: Jeff Layton Date: Wed, 12 Oct 2016 11:04:41 +0000 (-0400) Subject: client: fix AT_SYMLINK_NOFOLLOW handling X-Git-Tag: v11.1.0~625^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=08716fb0651e4baa33dd14d92e8899f65d45e6fd;p=ceph.git client: fix AT_SYMLINK_NOFOLLOW handling We're passing the reverse to path_walk. It should be true if we want to follow links. Fixes: f7c885e1f9cefc359f8b6fe7e51e212387432529 Fixes: bce221c1b99a564d2f4827d2f28cbe939184d308 Signed-off-by: Jeff Layton --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 1d74c1b511dd..e11325356330 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -6658,7 +6658,7 @@ int Client::setattrx(const char *relpath, struct ceph_statx *stx, int mask, filepath path(relpath); InodeRef in; - int r = path_walk(path, &in, perms, flags & AT_SYMLINK_NOFOLLOW); + int r = path_walk(path, &in, perms, !(flags & AT_SYMLINK_NOFOLLOW)); if (r < 0) return r; return _setattrx(in, stx, mask, perms); @@ -6738,7 +6738,7 @@ int Client::statx(const char *relpath, struct ceph_statx *stx, unsigned mask = statx_to_mask(flags, want); - int r = path_walk(path, &in, perms, flags & AT_SYMLINK_NOFOLLOW, mask); + int r = path_walk(path, &in, perms, !(flags & AT_SYMLINK_NOFOLLOW), mask); if (r < 0) return r;