Skip to content

Commit d39fc59

Browse files
author
Steve French
committed
cifs: release leases for deferred close handles when freezing
We should not be caching closed files when freeze is invoked on an fs (so we can release resources more gracefully). Fixes xfstests generic/068 generic/390 generic/491 Reviewed-by: David Howells <dhowells@redhat.com> Cc: <stable@vger.kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 716a3cf commit d39fc59

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

fs/cifs/cifsfs.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,20 @@ static void cifs_umount_begin(struct super_block *sb)
760760
return;
761761
}
762762

763+
static int cifs_freeze(struct super_block *sb)
764+
{
765+
struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
766+
struct cifs_tcon *tcon;
767+
768+
if (cifs_sb == NULL)
769+
return 0;
770+
771+
tcon = cifs_sb_master_tcon(cifs_sb);
772+
773+
cifs_close_all_deferred_files(tcon);
774+
return 0;
775+
}
776+
763777
#ifdef CONFIG_CIFS_STATS2
764778
static int cifs_show_stats(struct seq_file *s, struct dentry *root)
765779
{
@@ -798,6 +812,7 @@ static const struct super_operations cifs_super_ops = {
798812
as opens */
799813
.show_options = cifs_show_options,
800814
.umount_begin = cifs_umount_begin,
815+
.freeze_fs = cifs_freeze,
801816
#ifdef CONFIG_CIFS_STATS2
802817
.show_stats = cifs_show_stats,
803818
#endif

0 commit comments

Comments
 (0)