]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: fstat should take CEPH_STAT_CAP_INODE_ALL 9562/head
authorNoah Watkins <nwatkins@redhat.com>
Wed, 4 May 2016 09:22:14 +0000 (17:22 +0800)
committerAbhishek Varshney <abhishek.varshney@flipkart.com>
Tue, 7 Jun 2016 14:45:58 +0000 (20:15 +0530)
Fixes: http://tracker.ceph.com/issues/15723
Signed-off-by: Noah Watkins <nwatkins@redhat.com>
Signed-off-by: Yan, Zheng <zyan@redhat.com>
(cherry picked from commit 4b1a5d4ef9c3a116bb08100edd576819930047e3)

src/client/Client.cc
src/client/Client.h

index f2d9c4fdd0877d23d4f5897887dd5968f39a40de..f8da0be41625d30b657ea53ccdaabff7591f6d62 100644 (file)
@@ -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);
index d912db05c058ee19b4e25db3fc5679974aa11be4..860f28bd09d8fb568564163d00c9d2b025b94a1b 100644 (file)
@@ -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