Skip to content

Commit

Permalink
cifs: revalidate mapping when we open files for SMB1 POSIX
Browse files Browse the repository at this point in the history
RHBZ: 1933527

Under SMB1 + POSIX, if an inode is reused on a server after we have read and
cached a part of a file, when we then open the new file with the
re-cycled inode there is a chance that we may serve the old data out of cache
to the application.
This only happens for SMB1 (deprecated) and when posix are used.
The simplest solution to avoid this race is to force a revalidate
on smb1-posix open.

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>
  • Loading branch information
Ronnie Sahlberg authored and Steve French committed Mar 26, 2021
1 parent 3bffbe9 commit cee8f4f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/cifs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ int cifs_posix_open(char *full_path, struct inode **pinode,
goto posix_open_ret;
}
} else {
cifs_revalidate_mapping(*pinode);
cifs_fattr_to_inode(*pinode, &fattr);
}

Expand Down

0 comments on commit cee8f4f

Please sign in to comment.