ceph: clear dir complete on d_move
authorSage Weil <sage@newdream.net>
Fri, 16 Apr 2010 19:56:11 +0000 (12:56 -0700)
committerSage Weil <sage@newdream.net>
Mon, 3 May 2010 17:49:22 +0000 (10:49 -0700)
d_move() reorders the d_subdirs list, breaking the readdir result caching.
Unless/until d_move preserves that ordering, clear CEPH_I_COMPLETE on
rename.

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

index 26f883c275e85e6746f23884015d08777cbff95d..261f3e6c0bcff279d8a5177c0234c3d1e99ad9de 100644 (file)
@@ -997,6 +997,10 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req,
                             dn, dn->d_name.len, dn->d_name.name);
                        dout("fill_trace doing d_move %p -> %p\n",
                             req->r_old_dentry, dn);
+
+                       /* d_move screws up d_subdirs order */
+                       ceph_i_clear(dir, CEPH_I_COMPLETE);
+
                        d_move(req->r_old_dentry, dn);
                        dout(" src %p '%.*s' dst %p '%.*s'\n",
                             req->r_old_dentry,