diff options
author | Ronnie Sahlberg <lsahlber@redhat.com> | 2022-10-18 09:39:10 +0200 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2022-10-20 00:57:41 +0200 |
commit | 8e77860c62b6eac8bb5b567efe6b8cd232d5f72f (patch) | |
tree | cddd5d8128c02ebe156070c0767a90aaf70a3baf /fs/cifs/smb2inode.c | |
parent | smb3: interface count displayed incorrectly (diff) | |
download | linux-8e77860c62b6eac8bb5b567efe6b8cd232d5f72f.tar.xz linux-8e77860c62b6eac8bb5b567efe6b8cd232d5f72f.zip |
cifs: drop the lease for cached directories on rmdir or rename
When we delete or rename a directory we must also drop any cached lease we have
on the directory.
Fixes: a350d6e73f5e ("cifs: enable caching of directories for which a lease is held")
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/smb2inode.c')
-rw-r--r-- | fs/cifs/smb2inode.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/cifs/smb2inode.c b/fs/cifs/smb2inode.c index a6640e6ea58b..68e08c85fbb8 100644 --- a/fs/cifs/smb2inode.c +++ b/fs/cifs/smb2inode.c @@ -655,6 +655,7 @@ int smb2_rmdir(const unsigned int xid, struct cifs_tcon *tcon, const char *name, struct cifs_sb_info *cifs_sb) { + drop_cached_dir_by_name(xid, tcon, name, cifs_sb); return smb2_compound_op(xid, tcon, cifs_sb, name, DELETE, FILE_OPEN, CREATE_NOT_FILE, ACL_NO_MODE, NULL, SMB2_OP_RMDIR, NULL, NULL, NULL); @@ -698,6 +699,7 @@ smb2_rename_path(const unsigned int xid, struct cifs_tcon *tcon, { struct cifsFileInfo *cfile; + drop_cached_dir_by_name(xid, tcon, from_name, cifs_sb); cifs_get_writable_path(tcon, from_name, FIND_WR_WITH_DELETE, &cfile); return smb2_set_path_attr(xid, tcon, from_name, to_name, |