]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
ceph: avoid dcache readdir for snapdir
authorSage Weil <sage@newdream.net>
Thu, 22 Jul 2010 20:47:21 +0000 (13:47 -0700)
committerSage Weil <sage@newdream.net>
Thu, 22 Jul 2010 20:50:45 +0000 (13:50 -0700)
We should always go to the MDS for readdir on the hidden snapdir.  The
set of snapshots can change at any time; the client can't trust its cache
for that.

Signed-off-by: Sage Weil <sage@newdream.net>
fs/ceph/dir.c

index f85719310db2f7aa48d15dee2b3b278e5e8375e0..ea36ba9960d36993692967aa884b345af89658af 100644 (file)
@@ -266,6 +266,7 @@ static int ceph_readdir(struct file *filp, void *dirent, filldir_t filldir)
        spin_lock(&inode->i_lock);
        if ((filp->f_pos == 2 || fi->dentry) &&
            !ceph_test_opt(client, NOASYNCREADDIR) &&
+           ceph_snap(inode) != CEPH_SNAPDIR &&
            (ci->i_ceph_flags & CEPH_I_COMPLETE) &&
            __ceph_caps_issued_mask(ci, CEPH_CAP_FILE_SHARED, 1)) {
                err = __dcache_readdir(filp, dirent, filldir);