linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bug report] Inconsistent state with CIFS mount after interrupted process in Linux 5.10
@ 2021-01-13  7:21 Duncan Findlay
  2021-01-13 12:29 ` Aurélien Aptel
  0 siblings, 1 reply; 13+ messages in thread
From: Duncan Findlay @ 2021-01-13  7:21 UTC (permalink / raw)
  To: linux-cifs

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.


More details:

Client:
$ uname -a
Linux test 5.10.0-1-amd64 #1 SMP Debian 5.10.5-1 (2021-01-09) x86_64 GNU/Linux
$ sudo mount.cifs -V
mount.cifs version: 6.11

Samba Server:
$ sudo testparm --version
Version 4.13.3-Debian

In the logs below, the server and client are on the same
machine.

Partial /etc/samba/smb.conf:

[share]
comment = Test folder
path = /srv/test
read only = No

(Happy to share the rest, but it's likely uninteresting -- all default
Debian config.)


Logs:

Debug dmesg logs, while interrupting cat:

[  131.703533] CIFS: fs/cifs/file.c: Flush inode 00000000d8f49255 file
000000001e1eb942 rc 0
[  131.703541] CIFS: fs/cifs/file.c: closing last open instance for
inode 00000000d8f49255
[  131.703543] CIFS: fs/cifs/file.c: VFS: in _cifsFileInfo_put as Xid:
11 with uid: 1000
[  131.703545] CIFS: fs/cifs/smb2pdu.c: Close
[  131.703549] CIFS: fs/cifs/transport.c: signal pending before send request
[  131.703551] CIFS: fs/cifs/smb2ops.c: add 1 credits total=571
[  131.703559] cifs_small_buf_release: 2 callbacks suppressed
[  131.703559] CIFS: fs/cifs/misc.c: Null buffer passed to
cifs_small_buf_release

Debug dmesg logs from rm:

[  180.885931] CIFS: fs/cifs/inode.c: VFS: in
cifs_revalidate_dentry_attr as Xid: 13 with uid: 1000
[  180.885938] CIFS: fs/cifs/dir.c: name: \subdir
[  180.885944] CIFS: fs/cifs/inode.c: Update attributes: \subdir inode
0x000000008e2380dc count 1 dentry: 0x00000000568fd902 d_time
4294904495 jiffies 4294937505
[  180.885992] CIFS: fs/cifs/transport.c: Sending smb: smb_len=356
[  180.887242] CIFS: fs/cifs/connect.c: RFC1002 header 0x210
[  180.887255] CIFS: fs/cifs/smb2misc.c: SMB2 data length 56 offset 152
[  180.887258] smb2_calc_size: 3 callbacks suppressed
[  180.887259] CIFS: fs/cifs/smb2misc.c: SMB2 len 208
[  180.887269] CIFS: fs/cifs/smb2misc.c: SMB2 data length 114 offset 72
[  180.887271] CIFS: fs/cifs/smb2misc.c: SMB2 len 186
[  180.887274] CIFS: fs/cifs/smb2misc.c: Calculated size 186 length
192 mismatch mid 41
[  180.887281] CIFS: fs/cifs/smb2misc.c: SMB2 len 124
[  180.887284] CIFS: fs/cifs/smb2misc.c: Calculated size 124 length
128 mismatch mid 42
[  180.887287] CIFS: fs/cifs/smb2ops.c: add 30 credits total=598
[  180.887300] cifs_sync_mid_result: 2 callbacks suppressed
[  180.887302] CIFS: fs/cifs/transport.c: cifs_sync_mid_result: cmd=5
mid=40 state=4
[  180.887306] CIFS: fs/cifs/transport.c: cifs_sync_mid_result: cmd=16
mid=41 state=4
[  180.887309] CIFS: fs/cifs/transport.c: cifs_sync_mid_result: cmd=6
mid=42 state=4
[  180.887312] CIFS: fs/cifs/misc.c: Null buffer passed to
cifs_small_buf_release
[  180.887314] CIFS: fs/cifs/misc.c: Null buffer passed to
cifs_small_buf_release
[  180.887316] CIFS: fs/cifs/misc.c: Null buffer passed to
cifs_small_buf_release
[  180.887328] CIFS: fs/cifs/inode.c: cifs_revalidate_cache:
revalidating inode 10952654749510940080
[  180.887331] CIFS: fs/cifs/inode.c: cifs_revalidate_cache:
invalidating inode 10952654749510940080 mapping
[  180.887335] CIFS: fs/cifs/inode.c: VFS: leaving
cifs_revalidate_dentry_attr (xid = 13) rc = 0
[  180.887343] CIFS: fs/cifs/inode.c: VFS: in
cifs_revalidate_dentry_attr as Xid: 14 with uid: 1000
[  180.887346] CIFS: fs/cifs/dir.c: name: \foo
[  180.887348] CIFS: fs/cifs/dir.c: name: \subdir\foo
[  180.887353] CIFS: fs/cifs/inode.c: Update attributes: \subdir\foo
inode 0x00000000d8f49255 count 1 dentry: 0x000000006cae3b3c d_time 0
jiffies 4294937506
[  180.887385] CIFS: fs/cifs/transport.c: Sending smb: smb_len=364
[  180.888296] CIFS: fs/cifs/connect.c: RFC1002 header 0x218
[  180.888307] CIFS: fs/cifs/smb2misc.c: SMB2 data length 56 offset 152
[  180.888309] CIFS: fs/cifs/smb2misc.c: SMB2 len 208
[  180.888337] CIFS: fs/cifs/smb2misc.c: SMB2 data length 122 offset 72
[  180.888339] CIFS: fs/cifs/smb2misc.c: SMB2 len 194
[  180.888343] CIFS: fs/cifs/smb2misc.c: Calculated size 194 length
200 mismatch mid 44
[  180.888392] CIFS: fs/cifs/smb2misc.c: SMB2 len 124
[  180.888394] CIFS: fs/cifs/smb2misc.c: Calculated size 124 length
128 mismatch mid 45
[  180.888398] CIFS: fs/cifs/smb2ops.c: add 30 credits total=625
[  180.888427] CIFS: fs/cifs/transport.c: cifs_sync_mid_result: cmd=5
mid=43 state=4
[  180.888430] CIFS: fs/cifs/transport.c: cifs_sync_mid_result: cmd=16
mid=44 state=4
[  180.888433] CIFS: fs/cifs/transport.c: cifs_sync_mid_result: cmd=6
mid=45 state=4
[  180.888435] CIFS: fs/cifs/misc.c: Null buffer passed to
cifs_small_buf_release
[  180.888438] CIFS: fs/cifs/misc.c: Null buffer passed to
cifs_small_buf_release
[  180.888440] CIFS: fs/cifs/misc.c: Null buffer passed to
cifs_small_buf_release
[  180.888450] CIFS: fs/cifs/inode.c: cifs_revalidate_cache:
revalidating inode 10952654827393506808
[  180.888452] CIFS: fs/cifs/inode.c: cifs_revalidate_cache: inode
10952654827393506808 is unchanged
[  180.888457] CIFS: fs/cifs/inode.c: VFS: leaving
cifs_revalidate_dentry_attr (xid = 14) rc = 0
[  180.888534] CIFS: fs/cifs/inode.c: cifs_unlink,
dir=0x000000008e2380dc, dentry=0x000000006cae3b3c
[  180.888537] CIFS: fs/cifs/inode.c: VFS: in cifs_unlink as Xid: 15
with uid: 1000
[  180.888540] CIFS: fs/cifs/dir.c: name: \foo
[  180.888542] CIFS: fs/cifs/dir.c: name: \subdir\foo
[  180.888566] CIFS: fs/cifs/transport.c: Sending smb: smb_len=260
[  180.889623] CIFS: fs/cifs/connect.c: RFC1002 header 0x6c
[  180.889637] CIFS: fs/cifs/smb2misc.c: SMB2 len 108
[  180.889640] CIFS: fs/cifs/smb2misc.c: Checking for oplock break
[  180.889642] CIFS: fs/cifs/smb2misc.c: Checking for lease break
[  180.889645] CIFS: fs/cifs/smb2misc.c: Can not process lease break -
no lease matched
[  180.889647] CIFS: VFS: \\test No task to wake, unknown frame
received! NumMids 2
[  180.889748] CIFS: Received Data is: : dump of 64 bytes of data at
0x0000000009ce2743
[  180.889754] 00000000: 424d53fe 00000040 00000000 00000012  .SMB@...........
[  180.889757] 00000010: 00000001 00000000 ffffffff ffffffff  ................
[  180.889760] 00000020: 00000000 00000000 00000000 00000000  ................
[  180.889763] 00000030: 00000000 00000000 00000000 00000000  ................
[  180.890911] CIFS: fs/cifs/connect.c: RFC1002 header 0x49
[  180.890920] CIFS: fs/cifs/smb2misc.c: SMB2 data length 0 offset 0
[  180.890923] CIFS: fs/cifs/smb2misc.c: SMB2 len 73
[  215.893172] CIFS: fs/cifs/connect.c: RFC1002 header 0x150
[  215.893186] CIFS: fs/cifs/smb2misc.c: SMB2 data length 56 offset 152
[  215.893189] CIFS: fs/cifs/smb2misc.c: SMB2 len 208
[  215.893199] CIFS: fs/cifs/smb2misc.c: SMB2 len 124
[  215.893202] CIFS: fs/cifs/smb2misc.c: Calculated size 124 length
128 mismatch mid 47
[  215.893206] CIFS: fs/cifs/smb2ops.c: add 10 credits total=643
[  215.893230] CIFS: fs/cifs/transport.c: cifs_sync_mid_result: cmd=5
mid=46 state=4
[  215.893233] CIFS: fs/cifs/transport.c: cifs_sync_mid_result: cmd=6
mid=47 state=4
[  215.893236] CIFS: fs/cifs/misc.c: Null buffer passed to
cifs_small_buf_release
[  215.893240] CIFS: fs/cifs/misc.c: Null buffer passed to
cifs_small_buf_release
[  215.893249] CIFS: fs/cifs/inode.c: VFS: leaving cifs_unlink (xid = 15) rc = 0

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

end of thread, other threads:[~2021-01-14 17:24 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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).