]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
client: fix AT_SYMLINK_NOFOLLOW handling
authorJeff Layton <jlayton@redhat.com>
Wed, 12 Oct 2016 11:04:41 +0000 (07:04 -0400)
committerJeff Layton <jlayton@redhat.com>
Wed, 12 Oct 2016 11:04:41 +0000 (07:04 -0400)
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 <jlayton@redhat.com>
src/client/Client.cc

index 1d74c1b511dda4b5079a3ffbe111bf014d1d28eb..e11325356330f24c7805add92e085a260765b979 100644 (file)
@@ -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;