Skip to content

Commit

Permalink
ceph: ensure rename target dentry fails revalidation
Browse files Browse the repository at this point in the history
This works around a bug in vfs_rename_dir() that rehashes the target
dentry.  Ensure such dentries always fail revalidation by timing out the
dentry lease and kicking it out of the current directory lease gen.

This can be reverted when the vfs bug is fixed.

Signed-off-by: Sage Weil <sage@newdream.net>
  • Loading branch information
Sage Weil committed Dec 22, 2009
1 parent 2baba25 commit c4a29f2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/ceph/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,10 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req,
req->r_old_dentry->d_name.len,
req->r_old_dentry->d_name.name,
dn, dn->d_name.len, dn->d_name.name);
/* ensure target dentry is invalidated, despite
rehashing bug in vfs_rename_dir */
dn->d_time = jiffies;
ceph_dentry(dn)->lease_shared_gen = 0;
/* take overwritten dentry's readdir offset */
ceph_dentry(req->r_old_dentry)->offset =
ceph_dentry(dn)->offset;
Expand Down

0 comments on commit c4a29f2

Please sign in to comment.