All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paulo Alcantara <pc@cjr.nz>
To: "Pavel Shilovsky" <piastryyy@gmail.com>,
	"Aurélien Aptel" <aaptel@suse.com>,
	"Steve French" <smfrench@gmail.com>
Cc: Duncan Findlay <duncf@duncf.ca>, linux-cifs <linux-cifs@vger.kernel.org>
Subject: Re: [bug report] Inconsistent state with CIFS mount after interrupted process in Linux 5.10
Date: Wed, 13 Jan 2021 13:51:02 -0300	[thread overview]
Message-ID: <87h7nk6art.fsf@cjr.nz> (raw)
In-Reply-To: <CAKywueQ9jmyTaKqR2x0nL-Q8A=-V1fP_1L2n=b+OdUzVhV083Q@mail.gmail.com>

Pavel Shilovsky <piastryyy@gmail.com> writes:

> Thanks for reporting the issue.
>
> The problem is with the recent fix which changes the error code from
> -EINTR to -ERESTARTSYS:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/fs/cifs/transport.c?id=6988a619f5b79e4efadea6e19dcfe75fbcd350b5
>
> and this problem happens here:
>
> https://git.samba.org/sfrench/?p=sfrench/cifs-2.6.git;a=blob;f=fs/cifs/smb2pdu.c;h=067eb44c7baa863c1e7ccd2c2f599be0b067f320;hb=236237ab6de1cde004b0ab3e348fc530334270d5#l3251
>
> So, interrupted close commands don't get restarted by the client and
> the client leaks open handles on the server. The offending patch was
> tagged stable, so the fix seems quite urgent. The fix itself should be
> simple: replace -EINTR with -ERESTARTSYS in the IF condition or even
> amend it with "||".

Yes, makes sense.

Maybe we should do something like below

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 067eb44c7baa..794fc3b68b4f 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -3248,7 +3248,7 @@ __SMB2_close(const unsigned int xid, struct cifs_tcon *tcon,
 	free_rsp_buf(resp_buftype, rsp);
 
 	/* retry close in a worker thread if this one is interrupted */
-	if (rc == -EINTR) {
+	if (is_interrupt_error(rc)) {
 		int tmp_rc;
 
 		tmp_rc = smb2_handle_cancelled_close(tcon, persistent_fid,

  reply	other threads:[~2021-01-13 17:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13  7:21 [bug report] Inconsistent state with CIFS mount after interrupted process in Linux 5.10 Duncan Findlay
2021-01-13 12:29 ` Aurélien Aptel
2021-01-13 16:31   ` Pavel Shilovsky
2021-01-13 16:51     ` Paulo Alcantara [this message]
2021-01-13 17:02       ` Steve French
2021-01-13 17:16         ` [PATCH] cifs: fix interrupted close commands Paulo Alcantara
2021-01-13 18:28           ` Pavel Shilovsky
2021-01-14  7:32             ` Shyam Prasad N
2021-01-14 17:22               ` [EXTERNAL] " Pavel Shilovskiy
2021-01-13 18:35         ` [bug report] Inconsistent state with CIFS mount after interrupted process in Linux 5.10 Pavel Shilovsky
2021-01-14 15:21           ` Aurélien Aptel
2021-01-14 17:10             ` Pavel Shilovsky
2021-01-13 16:57     ` Steve French

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h7nk6art.fsf@cjr.nz \
    --to=pc@cjr.nz \
    --cc=aaptel@suse.com \
    --cc=duncf@duncf.ca \
    --cc=linux-cifs@vger.kernel.org \
    --cc=piastryyy@gmail.com \
    --cc=smfrench@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.