From: Sage Weil Date: Mon, 7 Apr 2008 23:40:52 +0000 (-0700) Subject: kclient: try to carry CAP_EXCL when we buffer data, even if file is now closed X-Git-Tag: v0.3~239^2~79 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b70ebdf607f9df79f441d4b8466b34fba32bf230;p=ceph.git kclient: try to carry CAP_EXCL when we buffer data, even if file is now closed --- diff --git a/src/kernel/super.h b/src/kernel/super.h index 1ff8093b5013f..d0b83cf841c4d 100644 --- a/src/kernel/super.h +++ b/src/kernel/super.h @@ -277,7 +277,10 @@ static inline int __ceph_caps_file_wanted(struct ceph_inode_info *ci) static inline int __ceph_caps_wanted(struct ceph_inode_info *ci) { - return __ceph_caps_file_wanted(ci) | __ceph_caps_used(ci); + int w = __ceph_caps_file_wanted(ci) | __ceph_caps_used(ci); + if (w & CEPH_CAP_WRBUFFER) + w |= CEPH_CAP_EXCL; /* want EXCL if we have dirty data */ + return w; } static inline int ceph_file_mode(int flags)