linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve French <smfrench@gmail.com>
To: Pavel Shilovsky <piastryyy@gmail.com>
Cc: "Aurélien Aptel" <aaptel@suse.com>,
	"Paulo Alcantara (SUSE)" <pc@cjr.nz>,
	"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 10:57:40 -0600	[thread overview]
Message-ID: <CAH2r5mvr2VWQLWRF_nHRc=S4ynhpixZAyM43qoo6OXp32-MkXQ@mail.gmail.com> (raw)
In-Reply-To: <CAKywueQ9jmyTaKqR2x0nL-Q8A=-V1fP_1L2n=b+OdUzVhV083Q@mail.gmail.com>

Pavel's explanation looks plausible.


On Wed, Jan 13, 2021 at 10:31 AM Pavel Shilovsky <piastryyy@gmail.com> wrote:
>
> 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 "||".
>
> Adding Paulo and Steve to comment.
>
> --
> Best regards,
> Pavel Shilovsky
>
> ср, 13 янв. 2021 г. в 04:31, Aurélien Aptel <aaptel@suse.com>:
> >
> > Duncan Findlay <duncf@duncf.ca> writes:
> > > There seems to be a problem with the CIFS module in Linux 5.10. Files
> > > that are opened and not cleanly closed end up in an inconsistent
> > > state. This can be triggered by writing to a file and interrupting the
> > > writer with Ctrl-C. Once this happens, attempting to delete the file
> > > causes access to the mount to hang. Afterwards, the files are visible
> > > to ls, but cannot be accessed or deleted.
> > >
> > > I'm running Debian unstable with a Debian unstable kernel
> > > (5.10.5-1). I attempted to but could not reproduce this with a 4.19 kernel.
> > >
> > >
> > > Repro steps:
> > >
> > > $ sudo mount -t cifs //test/share /mnt/test --verbose -o
> > > rw,user,auto,nosuid,uid=user,gid=user,vers=3.1.1,credentials=/home/user/tmp/creds
> > > $ mkdir /mnt/test/subdir
> > > $ cat > /mnt/test/subdir/foo
> > > [ Hit Ctrl-C to interrupt ]
> > > $ ls /mnt/test/subdir/
> > > foo
> > > $ rm /mnt/test/subdir/foo
> > > [ Hangs for 35 seconds, errors in dmesg log -- see below ]
> > > $ ls /mnt/test/subdir/
> > > foo
> > > $ stat /mnt/test/subdir/foo
> > > stat: cannot statx '/mnt/test/subdir/foo': No such file or directory
> > >
> > > At this point, the file still exists on the server side, and
> > > restarting the server causes it to be deleted.
> > >
> > > I can provide pcaps if necessary. It looks like with 4.19, when the
> > > cat command is killed, the client sends a Close Request, and on 5.10
> > > no commands are sent.
> >
> > I can reproduce this on Steve's current for-next branch but only against
> > a Samba server.
> >
> > On Windows server, doing ^C kills cat properly but the output file is
> > never created, which is also a bug.
> >
> > Cheers,
> > --
> > Aurélien Aptel / SUSE Labs Samba Team
> > GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
> > SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg, DE
> > GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 247165 (AG München)
> >



--
Thanks,

Steve

      parent reply	other threads:[~2021-01-13 16:58 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
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 [this message]

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='CAH2r5mvr2VWQLWRF_nHRc=S4ynhpixZAyM43qoo6OXp32-MkXQ@mail.gmail.com' \
    --to=smfrench@gmail.com \
    --cc=aaptel@suse.com \
    --cc=duncf@duncf.ca \
    --cc=linux-cifs@vger.kernel.org \
    --cc=pc@cjr.nz \
    --cc=piastryyy@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 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).