From: Noah Watkins Date: Wed, 4 May 2016 09:22:14 +0000 (+0800) Subject: client: fstat should take CEPH_STAT_CAP_INODE_ALL X-Git-Tag: v10.2.3~95^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c02501005b0316ba9f0ae1cd316a92c567b37c3b;p=ceph.git client: fstat should take CEPH_STAT_CAP_INODE_ALL Fixes: http://tracker.ceph.com/issues/15723 Signed-off-by: Noah Watkins Signed-off-by: Yan, Zheng (cherry picked from commit 4b1a5d4ef9c3a116bb08100edd576819930047e3) --- diff --git a/src/client/Client.cc b/src/client/Client.cc index f2d9c4fdd087..f8da0be41625 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -8668,16 +8668,16 @@ int Client::_fsync(Fh *f, bool syncdataonly) return _fsync(f->inode.get(), syncdataonly); } -int Client::fstat(int fd, struct stat *stbuf) +int Client::fstat(int fd, struct stat *stbuf, int mask) { Mutex::Locker lock(client_lock); - tout(cct) << "fstat" << std::endl; + tout(cct) << "fstat mask " << hex << mask << std::endl; tout(cct) << fd << std::endl; Fh *f = get_filehandle(fd); if (!f) return -EBADF; - int r = _getattr(f->inode, -1); + int r = _getattr(f->inode, mask); if (r < 0) return r; fill_stat(f->inode, stbuf, NULL); diff --git a/src/client/Client.h b/src/client/Client.h index d912db05c058..860f28bd09d8 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -981,7 +981,7 @@ public: int fake_write_size(int fd, loff_t size); int ftruncate(int fd, loff_t size); int fsync(int fd, bool syncdataonly); - int fstat(int fd, struct stat *stbuf); + int fstat(int fd, struct stat *stbuf, int mask=CEPH_STAT_CAP_INODE_ALL); int fallocate(int fd, int mode, loff_t offset, loff_t length); // full path xattr ops