OSDN Git Service

smb3: fix temporary data corruption in insert range
authorDavid Howells <dhowells@redhat.com>
Tue, 23 Aug 2022 13:07:55 +0000 (14:07 +0100)
committerSteve French <stfrench@microsoft.com>
Mon, 29 Aug 2022 03:34:08 +0000 (22:34 -0500)
commit9c8b7a293f50253e694f19161c045817a938e551
tree0f9cc697706ca1dbbbab416a7980431298b3a20a
parentfa30a81f255a56cccd89552cd6ce7ea6e8d8acc4
smb3: fix temporary data corruption in insert range

insert range doesn't discard the affected cached region
so can risk temporarily corrupting file data.

Also includes some minor cleanup (avoiding rereading
inode size repeatedly unnecessarily) to make it clearer.

Cc: stable@vger.kernel.org
Fixes: 7fe6fe95b936 ("cifs: add FALLOC_FL_INSERT_RANGE support")
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/smb2ops.c