From 3050dad474928fc8e501e738304f2311f561d0eb Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Tue, 9 Feb 2010 11:08:40 -0800 Subject: [PATCH] --- yaml --- r: 188700 b: refs/heads/master c: 3d497d858ae6e5f23a28783030aecc69074e102d h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/ceph/inode.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index ab1c6fac8cf9..acff13a9b4d9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4af6b2257ee0eb8f4bf3b1dc8acb643c0e8a887f +refs/heads/master: 3d497d858ae6e5f23a28783030aecc69074e102d diff --git a/trunk/fs/ceph/inode.c b/trunk/fs/ceph/inode.c index a4f573ab232e..af85f2de2f7c 100644 --- a/trunk/fs/ceph/inode.c +++ b/trunk/fs/ceph/inode.c @@ -416,9 +416,17 @@ int ceph_fill_file_size(struct inode *inode, int issued, dout("truncate_seq %u -> %u\n", ci->i_truncate_seq, truncate_seq); ci->i_truncate_seq = truncate_seq; - if (issued & (CEPH_CAP_FILE_CACHE|CEPH_CAP_FILE_RD| + /* + * If we hold relevant caps, or in the case where we're + * not the only client referencing this file and we + * don't hold those caps, then we need to check whether + * the file is either opened or mmaped + */ + if ((issued & (CEPH_CAP_FILE_CACHE|CEPH_CAP_FILE_RD| CEPH_CAP_FILE_WR|CEPH_CAP_FILE_BUFFER| - CEPH_CAP_FILE_EXCL)) { + CEPH_CAP_FILE_EXCL)) || + mapping_mapped(inode->i_mapping) || + __ceph_caps_file_wanted(ci)) { ci->i_truncate_pending++; queue_trunc = 1; }