ceph-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ceph: remove the incorrect caps check in _file_size()
@ 2023-09-06 12:17 xiubli
  2023-09-06 14:45 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: xiubli @ 2023-09-06 12:17 UTC (permalink / raw)
  To: idryomov, ceph-devel; +Cc: jlayton, vshankar, mchangir, Xiubo Li, stable

From: Xiubo Li <xiubli@redhat.com>

When truncating the inode the MDS will acquire the xlock for the
ifile Locker, which will revoke the 'Frwsxl' caps from the clients.
But when the client just releases and flushes the 'Fw' caps to MDS,
for exmaple, and once the MDS receives the caps flushing msg it
just thought the revocation has finished. Then the MDS will continue
truncating the inode and then issued the truncate notification to
all the clients. While just before the clients receives the cap
flushing ack they receive the truncation notification, the clients
will detecte that the 'issued | dirty' is still holding the 'Fw'
caps.

Cc: stable@vger.kernel.org
URL: https://tracker.ceph.com/issues/56693
Signed-off-by: Xiubo Li <xiubli@redhat.com>
---
 fs/ceph/inode.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index ea6f966dacd5..8017b9e5864f 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -769,9 +769,7 @@ int ceph_fill_file_size(struct inode *inode, int issued,
 			ci->i_truncate_seq = truncate_seq;
 
 			/* the MDS should have revoked these caps */
-			WARN_ON_ONCE(issued & (CEPH_CAP_FILE_EXCL |
-					       CEPH_CAP_FILE_RD |
-					       CEPH_CAP_FILE_WR |
+			WARN_ON_ONCE(issued & (CEPH_CAP_FILE_RD |
 					       CEPH_CAP_FILE_LAZYIO));
 			/*
 			 * If we hold relevant caps, or in the case where we're
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ceph: remove the incorrect caps check in _file_size()
  2023-09-06 12:17 [PATCH] ceph: remove the incorrect caps check in _file_size() xiubli
@ 2023-09-06 14:45 ` Greg KH
  2023-09-07  0:14   ` Xiubo Li
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2023-09-06 14:45 UTC (permalink / raw)
  To: xiubli; +Cc: idryomov, ceph-devel, jlayton, vshankar, mchangir, stable

On Wed, Sep 06, 2023 at 08:17:47PM +0800, xiubli@redhat.com wrote:
> From: Xiubo Li <xiubli@redhat.com>
> 
> When truncating the inode the MDS will acquire the xlock for the
> ifile Locker, which will revoke the 'Frwsxl' caps from the clients.
> But when the client just releases and flushes the 'Fw' caps to MDS,
> for exmaple, and once the MDS receives the caps flushing msg it
> just thought the revocation has finished. Then the MDS will continue
> truncating the inode and then issued the truncate notification to
> all the clients. While just before the clients receives the cap
> flushing ack they receive the truncation notification, the clients
> will detecte that the 'issued | dirty' is still holding the 'Fw'
> caps.
> 
> Cc: stable@vger.kernel.org
> URL: https://tracker.ceph.com/issues/56693
> Signed-off-by: Xiubo Li <xiubli@redhat.com>
> ---
>  fs/ceph/inode.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

What commit id does this fix?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ceph: remove the incorrect caps check in _file_size()
  2023-09-06 14:45 ` Greg KH
@ 2023-09-07  0:14   ` Xiubo Li
  0 siblings, 0 replies; 3+ messages in thread
From: Xiubo Li @ 2023-09-07  0:14 UTC (permalink / raw)
  To: Greg KH; +Cc: idryomov, ceph-devel, jlayton, vshankar, mchangir, stable


On 9/6/23 22:45, Greg KH wrote:
> On Wed, Sep 06, 2023 at 08:17:47PM +0800, xiubli@redhat.com wrote:
>> From: Xiubo Li <xiubli@redhat.com>
>>
>> When truncating the inode the MDS will acquire the xlock for the
>> ifile Locker, which will revoke the 'Frwsxl' caps from the clients.
>> But when the client just releases and flushes the 'Fw' caps to MDS,
>> for exmaple, and once the MDS receives the caps flushing msg it
>> just thought the revocation has finished. Then the MDS will continue
>> truncating the inode and then issued the truncate notification to
>> all the clients. While just before the clients receives the cap
>> flushing ack they receive the truncation notification, the clients
>> will detecte that the 'issued | dirty' is still holding the 'Fw'
>> caps.
>>
>> Cc: stable@vger.kernel.org
>> URL: https://tracker.ceph.com/issues/56693
>> Signed-off-by: Xiubo Li <xiubli@redhat.com>
>> ---
>>   fs/ceph/inode.c | 4 +---
>>   1 file changed, 1 insertion(+), 3 deletions(-)
> What commit id does this fix?

Oh, I forgot to mention that in the commit comment, it will fix:

b0d7c2231015 ceph: introduce i_truncate_mutex

Let me update the patch and send out the V2 for it.

Thanks

- Xiubo



> thanks,
>
> greg k-h
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-09-07  0:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-06 12:17 [PATCH] ceph: remove the incorrect caps check in _file_size() xiubli
2023-09-06 14:45 ` Greg KH
2023-09-07  0:14   ` Xiubo Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).