diff options
author | Yan, Zheng <zyan@redhat.com> | 2015-05-25 05:36:42 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2015-06-25 04:49:30 -0400 |
commit | 41445999aeec1f0fdf196ab55b2c770473b2ea01 (patch) | |
tree | 35d1112d66d1fc1c07aec89c54047bff6583363c /fs/ceph | |
parent | 3e0708b990f7e46d87d47b3b06de322490f2f2ee (diff) |
ceph: don't include used caps in cap_wanted
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>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/caps.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 245ca381a6dc..a80a899e5c41 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c | |||
@@ -1525,13 +1525,13 @@ retry: | |||
1525 | retry_locked: | 1525 | retry_locked: |
1526 | file_wanted = __ceph_caps_file_wanted(ci); | 1526 | file_wanted = __ceph_caps_file_wanted(ci); |
1527 | used = __ceph_caps_used(ci); | 1527 | used = __ceph_caps_used(ci); |
1528 | want = file_wanted | used; | ||
1529 | issued = __ceph_caps_issued(ci, &implemented); | 1528 | issued = __ceph_caps_issued(ci, &implemented); |
1530 | revoking = implemented & ~issued; | 1529 | revoking = implemented & ~issued; |
1531 | 1530 | ||
1532 | retain = want | CEPH_CAP_PIN; | 1531 | want = file_wanted; |
1532 | retain = file_wanted | used | CEPH_CAP_PIN; | ||
1533 | if (!mdsc->stopping && inode->i_nlink > 0) { | 1533 | if (!mdsc->stopping && inode->i_nlink > 0) { |
1534 | if (want) { | 1534 | if (file_wanted) { |
1535 | retain |= CEPH_CAP_ANY; /* be greedy */ | 1535 | retain |= CEPH_CAP_ANY; /* be greedy */ |
1536 | } else if (S_ISDIR(inode->i_mode) && | 1536 | } else if (S_ISDIR(inode->i_mode) && |
1537 | (issued & CEPH_CAP_FILE_SHARED) && | 1537 | (issued & CEPH_CAP_FILE_SHARED) && |