aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2010-11-18 12:15:07 -0500
committerSage Weil <sage@newdream.net>2010-11-18 12:15:07 -0500
commit3105c19c450ac7c18ab28c19d364b588767261b3 (patch)
tree2b306fb3b8536f5f92f085993bbd966d9eb3929a /fs/ceph
parent7b88dadc13e0004947de52df128dbd5b0754ed0a (diff)
ceph: fix readdir EOVERFLOW on 32-bit archs
One of the readdir filldir_t callers was passing the raw ceph 64-bit ino instead of the hashed 32-bit one, producing an EOVERFLOW in the filler callback. Fix this by calling the ceph_vino_to_ino() helper to do the conversion. Reported-by: Jan Smets <jan.smets@alcatel-lucent.com> Tested-by: Jan Smets <jan.smets@alcatel-lucent.com> Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/dir.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index 5f67728ba4d7..7d447af84ec4 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -358,18 +358,22 @@ more:
358 u64 pos = ceph_make_fpos(frag, off); 358 u64 pos = ceph_make_fpos(frag, off);
359 struct ceph_mds_reply_inode *in = 359 struct ceph_mds_reply_inode *in =
360 rinfo->dir_in[off - fi->offset].in; 360 rinfo->dir_in[off - fi->offset].in;
361 struct ceph_vino vino;
362 ino_t ino;
363
361 dout("readdir off %d (%d/%d) -> %lld '%.*s' %p\n", 364 dout("readdir off %d (%d/%d) -> %lld '%.*s' %p\n",
362 off, off - fi->offset, rinfo->dir_nr, pos, 365 off, off - fi->offset, rinfo->dir_nr, pos,
363 rinfo->dir_dname_len[off - fi->offset], 366 rinfo->dir_dname_len[off - fi->offset],
364 rinfo->dir_dname[off - fi->offset], in); 367 rinfo->dir_dname[off - fi->offset], in);
365 BUG_ON(!in); 368 BUG_ON(!in);
366 ftype = le32_to_cpu(in->mode) >> 12; 369 ftype = le32_to_cpu(in->mode) >> 12;
370 vino.ino = le64_to_cpu(in->ino);
371 vino.snap = le64_to_cpu(in->snapid);
372 ino = ceph_vino_to_ino(vino);
367 if (filldir(dirent, 373 if (filldir(dirent,
368 rinfo->dir_dname[off - fi->offset], 374 rinfo->dir_dname[off - fi->offset],
369 rinfo->dir_dname_len[off - fi->offset], 375 rinfo->dir_dname_len[off - fi->offset],
370 pos, 376 pos, ino, ftype) < 0) {
371 le64_to_cpu(in->ino),
372 ftype) < 0) {
373 dout("filldir stopping us...\n"); 377 dout("filldir stopping us...\n");
374 return 0; 378 return 0;
375 } 379 }