summaryrefslogtreecommitdiffstats
path: root/fs/ceph/mds_client.c
diff options
context:
space:
mode:
authorJim Schutt <jaschut@sandia.gov>2013-05-15 13:03:35 -0500
committerAlex Elder <elder@inktank.com>2013-05-17 12:45:43 -0500
commitc420276a532a10ef59849adc2681f45306166b89 (patch)
tree2930964454c9e6e83709d5f96407a4b53a7e6f65 /fs/ceph/mds_client.c
parent14d2f38df67fadee34625fcbd282ee22514c4846 (diff)
downloadblackbird-op-linux-c420276a532a10ef59849adc2681f45306166b89.tar.gz
blackbird-op-linux-c420276a532a10ef59849adc2681f45306166b89.zip
ceph: add cpu_to_le32() calls when encoding a reconnect capability
In his review, Alex Elder mentioned that he hadn't checked that num_fcntl_locks and num_flock_locks were properly decoded on the server side, from a le32 over-the-wire type to a cpu type. I checked, and AFAICS it is done; those interested can consult Locker::_do_cap_update() in src/mds/Locker.cc and src/include/encoding.h in the Ceph server code (git://github.com/ceph/ceph). I also checked the server side for flock_len decoding, and I believe that also happens correctly, by virtue of having been declared __le32 in struct ceph_mds_cap_reconnect, in src/include/ceph_fs.h. Cc: stable@vger.kernel.org # 3.4+ Signed-off-by: Jim Schutt <jaschut@sandia.gov> Reviewed-by: Alex Elder <elder@inktank.com>
Diffstat (limited to 'fs/ceph/mds_client.c')
-rw-r--r--fs/ceph/mds_client.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 4f22671a5bd4..d9ca15255477 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -2485,7 +2485,7 @@ static int encode_caps_cb(struct inode *inode, struct ceph_cap *cap,
lock_flocks();
ceph_count_locks(inode, &num_fcntl_locks,
&num_flock_locks);
- rec.v2.flock_len = (2*sizeof(u32) +
+ rec.v2.flock_len = cpu_to_le32(2*sizeof(u32) +
(num_fcntl_locks+num_flock_locks) *
sizeof(struct ceph_filelock));
unlock_flocks();
OpenPOWER on IntegriCloud