Skip to content

Commit

Permalink
ceph: re-request max_size if cap auth changes
Browse files Browse the repository at this point in the history
If the auth cap migrates to another MDS, clear requested_max_size so that
we resend any pending max_size increase requests.  This fixes potential
hangs on writes that extend a file and race with an cap migration between
MDSs.

Signed-off-by: Sage Weil <sage@newdream.net>
  • Loading branch information
Sage Weil committed Nov 7, 2010
1 parent 912a9b0 commit feb4cc9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fs/ceph/caps.c
Original file line number Diff line number Diff line change
Expand Up @@ -2689,6 +2689,11 @@ static void handle_cap_import(struct ceph_mds_client *mdsc,
NULL /* no caps context */);
try_flush_caps(inode, session, NULL);
up_read(&mdsc->snap_rwsem);

/* make sure we re-request max_size, if necessary */
spin_lock(&inode->i_lock);
ci->i_requested_max_size = 0;
spin_unlock(&inode->i_lock);
}

/*
Expand Down

0 comments on commit feb4cc9

Please sign in to comment.