diff options
author | Sage Weil <sage@newdream.net> | 2010-11-18 09:15:07 -0800 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2010-11-18 09:15:07 -0800 |
commit | 3105c19c450ac7c18ab28c19d364b588767261b3 (patch) | |
tree | 2b306fb3b8536f5f92f085993bbd966d9eb3929a | |
parent | 7b88dadc13e0004947de52df128dbd5b0754ed0a (diff) | |
download | kernel_samsung_smdk4412-3105c19c450ac7c18ab28c19d364b588767261b3.zip kernel_samsung_smdk4412-3105c19c450ac7c18ab28c19d364b588767261b3.tar.gz kernel_samsung_smdk4412-3105c19c450ac7c18ab28c19d364b588767261b3.tar.bz2 |
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>
-rw-r--r-- | fs/ceph/dir.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index 5f67728..7d447af 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c @@ -358,18 +358,22 @@ more: u64 pos = ceph_make_fpos(frag, off); struct ceph_mds_reply_inode *in = rinfo->dir_in[off - fi->offset].in; + struct ceph_vino vino; + ino_t ino; + dout("readdir off %d (%d/%d) -> %lld '%.*s' %p\n", off, off - fi->offset, rinfo->dir_nr, pos, rinfo->dir_dname_len[off - fi->offset], rinfo->dir_dname[off - fi->offset], in); BUG_ON(!in); ftype = le32_to_cpu(in->mode) >> 12; + vino.ino = le64_to_cpu(in->ino); + vino.snap = le64_to_cpu(in->snapid); + ino = ceph_vino_to_ino(vino); if (filldir(dirent, rinfo->dir_dname[off - fi->offset], rinfo->dir_dname_len[off - fi->offset], - pos, - le64_to_cpu(in->ino), - ftype) < 0) { + pos, ino, ftype) < 0) { dout("filldir stopping us...\n"); return 0; } |