]> git.baikalelectronics.ru Git - kernel.git/commit
smb3: fix temporary data corruption in collapse range
authorSteve French <stfrench@microsoft.com>
Tue, 23 Aug 2022 13:07:41 +0000 (14:07 +0100)
committerSteve French <stfrench@microsoft.com>
Mon, 29 Aug 2022 03:34:07 +0000 (22:34 -0500)
commit366855213f7db7af4ad48906bc06f93e206e7b0a
tree7cfd66e49ee222d5ca364c2ae0fd507194e744fa
parent3a5add30ef73858acf276f1d841971b766faf0d0
smb3: fix temporary data corruption in collapse range

collapse range doesn't discard the affected cached region
so can risk temporarily corrupting the file data. This
fixes xfstest generic/031

I also decided to merge a minor cleanup to this into the same patch
(avoiding rereading inode size repeatedly unnecessarily) to make it
clearer.

Cc: stable@vger.kernel.org
Fixes: 04c07efe4d0db ("cifs: add support for FALLOC_FL_COLLAPSE_RANGE")
Reported-by: David Howells <dhowells@redhat.com>
Tested-by: David Howells <dhowells@redhat.com>
Reviewed-by: David Howells <dhowells@redhat.com>
cc: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/smb2ops.c