diff mbox series

[v2] ceph: remove the incorrect caps check in _file_size()

Message ID 20230907002211.633935-1-xiubli@redhat.com (mailing list archive)
State New, archived
Headers show
Series [v2] ceph: remove the incorrect caps check in _file_size() | expand

Commit Message

Xiubo Li Sept. 7, 2023, 12:22 a.m. UTC
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.

Fixes: b0d7c2231015 ("ceph: introduce i_truncate_mutex")
Cc: stable@vger.kernel.org
URL: https://tracker.ceph.com/issues/56693
Signed-off-by: Xiubo Li <xiubli@redhat.com>
---

V2:
- Added the info about which commit it's fixing


 fs/ceph/inode.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Milind Changire Oct. 9, 2023, 8:08 a.m. UTC | #1
Looks good to me

Reviewed-by: Milind Changire <mchangir@redhat.com>

On Thu, Sep 7, 2023 at 5:54 AM <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.
>
> Fixes: b0d7c2231015 ("ceph: introduce i_truncate_mutex")
> Cc: stable@vger.kernel.org
> URL: https://tracker.ceph.com/issues/56693
> Signed-off-by: Xiubo Li <xiubli@redhat.com>
> ---
>
> V2:
> - Added the info about which commit it's fixing
>
>
>  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
>
diff mbox series

Patch

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