Commit 4c66673
cifs: fix missing unlock in cifs_file_copychunk_range()
BugLink: https://bugs.launchpad.net/bugs/2036450
xfstests generic/013 and generic/476 reported WARNING as follows:
WARNING: lock held when returning to user space!
6.1.0-rc5+ #4 Not tainted
------------------------------------------------
fsstress/504233 is leaving the kernel with locks still held!
2 locks held by fsstress/504233:
#0: ffff888054c38850 (&sb->s_type->i_mutex_key#21){+.+.}-{3:3}, at:
lock_two_nondirectories+0xcf/0xf0
#1: ffff8880b8fec750 (&sb->s_type->i_mutex_key#21/4){+.+.}-{3:3}, at:
lock_two_nondirectories+0xb7/0xf0
This will lead to deadlock and hungtask.
Fix this by releasing locks when failed to write out on a file range in
cifs_file_copychunk_range().
Fixes: 3e3761f ("smb3: use filemap_write_and_wait_range instead of filemap_write_and_wait")
Cc: [email protected] # 6.0
Reviewed-by: Paulo Alcantara (SUSE) <[email protected]>
Signed-off-by: ChenXiaoSong <[email protected]>
Signed-off-by: Steve French <[email protected]>
(cherry picked from commit 5024878)
Signed-off-by: Tim Gardner <[email protected]>1 parent deea8af commit 4c66673
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1274 | 1274 | | |
1275 | 1275 | | |
1276 | 1276 | | |
1277 | | - | |
| 1277 | + | |
1278 | 1278 | | |
1279 | 1279 | | |
1280 | 1280 | | |
| |||
1290 | 1290 | | |
1291 | 1291 | | |
1292 | 1292 | | |
| 1293 | + | |
| 1294 | + | |
1293 | 1295 | | |
1294 | 1296 | | |
1295 | 1297 | | |
| |||
0 commit comments