diff options
author | Sage Weil <sage@newdream.net> | 2010-08-22 18:16:41 -0400 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2010-08-22 18:16:41 -0400 |
commit | 082afec92d1052305af1195f591602f4d0f44277 (patch) | |
tree | 7012fc71ac7be7bd88f2b0d92f27a3ba46c354de /fs | |
parent | f3c60c5918f26ea16761ddc8b12d8401a3db626b (diff) |
ceph: fix xattr cap writeback
We should include the xattr metadata blob in the cap update message any
time we are flushing dirty state, NOT just when we are also dropping the
cap. This fixes async xattr writeback.
Also, clean up the code slightly to avoid duplicating the bit test.
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ceph/caps.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 7bf182b03973..0ac2703f3bdf 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c | |||
@@ -1082,6 +1082,7 @@ static int __send_cap(struct ceph_mds_client *mdsc, struct ceph_cap *cap, | |||
1082 | gid_t gid; | 1082 | gid_t gid; |
1083 | struct ceph_mds_session *session; | 1083 | struct ceph_mds_session *session; |
1084 | u64 xattr_version = 0; | 1084 | u64 xattr_version = 0; |
1085 | struct ceph_buffer *xattr_blob = NULL; | ||
1085 | int delayed = 0; | 1086 | int delayed = 0; |
1086 | u64 flush_tid = 0; | 1087 | u64 flush_tid = 0; |
1087 | int i; | 1088 | int i; |
@@ -1160,9 +1161,10 @@ static int __send_cap(struct ceph_mds_client *mdsc, struct ceph_cap *cap, | |||
1160 | gid = inode->i_gid; | 1161 | gid = inode->i_gid; |
1161 | mode = inode->i_mode; | 1162 | mode = inode->i_mode; |
1162 | 1163 | ||
1163 | if (dropping & CEPH_CAP_XATTR_EXCL) { | 1164 | if (flushing & CEPH_CAP_XATTR_EXCL) { |
1164 | __ceph_build_xattrs_blob(ci); | 1165 | __ceph_build_xattrs_blob(ci); |
1165 | xattr_version = ci->i_xattrs.version + 1; | 1166 | xattr_blob = ci->i_xattrs.blob; |
1167 | xattr_version = ci->i_xattrs.version; | ||
1166 | } | 1168 | } |
1167 | 1169 | ||
1168 | spin_unlock(&inode->i_lock); | 1170 | spin_unlock(&inode->i_lock); |
@@ -1170,9 +1172,7 @@ static int __send_cap(struct ceph_mds_client *mdsc, struct ceph_cap *cap, | |||
1170 | ret = send_cap_msg(session, ceph_vino(inode).ino, cap_id, | 1172 | ret = send_cap_msg(session, ceph_vino(inode).ino, cap_id, |
1171 | op, keep, want, flushing, seq, flush_tid, issue_seq, mseq, | 1173 | op, keep, want, flushing, seq, flush_tid, issue_seq, mseq, |
1172 | size, max_size, &mtime, &atime, time_warp_seq, | 1174 | size, max_size, &mtime, &atime, time_warp_seq, |
1173 | uid, gid, mode, | 1175 | uid, gid, mode, xattr_version, xattr_blob, |
1174 | xattr_version, | ||
1175 | (flushing & CEPH_CAP_XATTR_EXCL) ? ci->i_xattrs.blob : NULL, | ||
1176 | follows); | 1176 | follows); |
1177 | if (ret < 0) { | 1177 | if (ret < 0) { |
1178 | dout("error sending cap msg, must requeue %p\n", inode); | 1178 | dout("error sending cap msg, must requeue %p\n", inode); |