summaryrefslogtreecommitdiffstats
path: root/fs/ceph/file.c
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2014-09-16 21:46:17 +0800
committerIlya Dryomov <idryomov@redhat.com>2014-10-14 21:03:38 +0400
commit508b32d8661b12da4c9ca41a9b2054e1dc92fa7e (patch)
tree81b68ad636814b6ffbc3af1be01276a038b50759 /fs/ceph/file.c
parentb76f82398c1017e303d87760e22125714010207f (diff)
downloadlinux-508b32d8661b12da4c9ca41a9b2054e1dc92fa7e.tar.gz
linux-508b32d8661b12da4c9ca41a9b2054e1dc92fa7e.tar.bz2
linux-508b32d8661b12da4c9ca41a9b2054e1dc92fa7e.zip
ceph: request xattrs if xattr_version is zero
Following sequence of events can happen. - Client releases an inode, queues cap release message. - A 'lookup' reply brings the same inode back, but the reply doesn't contain xattrs because MDS didn't receive the cap release message and thought client already has up-to-data xattrs. The fix is force sending a getattr request to MDS if xattrs_version is 0. The getattr mask is set to CEPH_STAT_CAP_XATTR, so MDS knows client does not have xattr. Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph/file.c')
-rw-r--r--fs/ceph/file.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 2eb02f80a0ab..e5203174634d 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -826,8 +826,7 @@ again:
ceph_put_cap_refs(ci, got);
if (checkeof && ret >= 0) {
- int statret = ceph_do_getattr(inode,
- CEPH_STAT_CAP_SIZE);
+ int statret = ceph_do_getattr(inode, CEPH_STAT_CAP_SIZE, false);
/* hit EOF or hole? */
if (statret == 0 && iocb->ki_pos < inode->i_size &&
@@ -995,7 +994,7 @@ static loff_t ceph_llseek(struct file *file, loff_t offset, int whence)
mutex_lock(&inode->i_mutex);
if (whence == SEEK_END || whence == SEEK_DATA || whence == SEEK_HOLE) {
- ret = ceph_do_getattr(inode, CEPH_STAT_CAP_SIZE);
+ ret = ceph_do_getattr(inode, CEPH_STAT_CAP_SIZE, false);
if (ret < 0) {
offset = ret;
goto out;