ALT Linux Bugzilla
– Attachment 7907 Details for
Bug 35731
Неожиданное поведение при попытке залочить файл на samba
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
[PATCH] cifs: Fixed OFD locks do not conflict with eachother
0001-cifs-Fixed-OFD-locks-do-not-conflict-with-eachother.patch (text/plain), 2.12 KB, created by
Georgy A Bystrenin
on 2018-12-14 21:47:03 MSK
(
hide
)
Description:
[PATCH] cifs: Fixed OFD locks do not conflict with eachother
Filename:
MIME Type:
Creator:
Georgy A Bystrenin
Created:
2018-12-14 21:47:03 MSK
Size:
2.12 KB
patch
obsolete
>From 210f7b4f832ebebcce082c0c6f110c1889dc3635 Mon Sep 17 00:00:00 2001 >From: Georgy A Bystrenin <gkot@altlinux.org> >Date: Thu, 13 Dec 2018 18:32:00 +0400 >Subject: [PATCH] cifs: Fixed OFD locks do not conflict with eachother > >While resolving a bug with locks on samba shares found a strange behavior. >When a file locked by one node and we trying to lock it from another node >it fail with errno 5 (EIO) but in that case errno must be set to (EACCES | EAGAIN). >This isn't happening when we try to lock file second time on same node. >In this case it returns EACCES as expected. >Also this issue not reproduces when we use SMB1 protocol (vers=1.0 in mount options). > >Further investigation showed that the mapping from status_to_posix_error >is different for SMB1 and SMB2+ implementations. >For SMB1 mapping is [NT_STATUS_LOCK_NOT_GRANTED to ERRlock] >(https://github.com/torvalds/linux/blob/master/fs/cifs/netmisc.c#L66) >but for SMB2+ mapping is [STATUS_LOCK_NOT_GRANTED to -EIO] >(https://github.com/torvalds/linux/blob/master/fs/cifs/smb2maperror.c#L383) > >Quick changes in SMB2+ mapping from EIO to EACCES has fixed issue. > >BUG: https://bugzilla.kernel.org/show_bug.cgi?id=201971 > >Signed-off-by: Georgy A Bystrenin <gkot@altlinux.org> >--- > fs/cifs/smb2maperror.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/fs/cifs/smb2maperror.c b/fs/cifs/smb2maperror.c >index 62c88dfed57b..d7e839cb773f 100644 >--- a/fs/cifs/smb2maperror.c >+++ b/fs/cifs/smb2maperror.c >@@ -378,8 +378,8 @@ static const struct status_to_posix_error smb2_error_map_table[] = { > {STATUS_NONEXISTENT_EA_ENTRY, -EIO, "STATUS_NONEXISTENT_EA_ENTRY"}, > {STATUS_NO_EAS_ON_FILE, -ENODATA, "STATUS_NO_EAS_ON_FILE"}, > {STATUS_EA_CORRUPT_ERROR, -EIO, "STATUS_EA_CORRUPT_ERROR"}, >- {STATUS_FILE_LOCK_CONFLICT, -EIO, "STATUS_FILE_LOCK_CONFLICT"}, >- {STATUS_LOCK_NOT_GRANTED, -EIO, "STATUS_LOCK_NOT_GRANTED"}, >+ {STATUS_FILE_LOCK_CONFLICT, -EACCES, "STATUS_FILE_LOCK_CONFLICT"}, >+ {STATUS_LOCK_NOT_GRANTED, -EACCES, "STATUS_LOCK_NOT_GRANTED"}, > {STATUS_DELETE_PENDING, -ENOENT, "STATUS_DELETE_PENDING"}, > {STATUS_CTL_FILE_NOT_SUPPORTED, -ENOSYS, > "STATUS_CTL_FILE_NOT_SUPPORTED"}, >-- >2.17.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 35731
:
7881
|
7882
|
7890
| 7907