Skip to content

Commit

Permalink
ceph: don't include used caps in cap_wanted
Browse files Browse the repository at this point in the history
when copying files to cephfs, file data may stay in page cache after
corresponding file is closed. Cached data use Fc capability. If we
include Fc capability in cap_wanted, MDS will treat files with cached
data as open files, and journal them in an EOpen event when trimming
log segment.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
  • Loading branch information
Yan, Zheng authored and Ilya Dryomov committed Jun 25, 2015
1 parent 3e0708b commit 4144599
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/ceph/caps.c
Original file line number Diff line number Diff line change
Expand Up @@ -1525,13 +1525,13 @@ void ceph_check_caps(struct ceph_inode_info *ci, int flags,
retry_locked:
file_wanted = __ceph_caps_file_wanted(ci);
used = __ceph_caps_used(ci);
want = file_wanted | used;
issued = __ceph_caps_issued(ci, &implemented);
revoking = implemented & ~issued;

retain = want | CEPH_CAP_PIN;
want = file_wanted;
retain = file_wanted | used | CEPH_CAP_PIN;
if (!mdsc->stopping && inode->i_nlink > 0) {
if (want) {
if (file_wanted) {
retain |= CEPH_CAP_ANY; /* be greedy */
} else if (S_ISDIR(inode->i_mode) &&
(issued & CEPH_CAP_FILE_SHARED) &&
Expand Down

0 comments on commit 4144599

Please sign in to comment.