Re: [PATCH 5/5] smb: During umount, flush any pending lease breaks for cached dirs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Aah - thanks for this, I will try to test it out as well, and could be
very important if it also addresses a problem with the laundromat
cleanup race (with directory lease freeing) that I have also seen on
umount to Windows server.

Are there other patches in the series you want us to look at and/or
test (your email said patch 5/5)?


On Fri, Nov 8, 2024 at 4:29 PM Paul Aurich <paul@xxxxxxxxxxxxxx> wrote:
>
> *** WORK IN PROGRESS ***
>
> If a lease break is received right as a filesystem is being unmounted,
> it's possible for cifs_kill_sb() to race with a queued
> smb2_cached_lease_break(). Since the cfid is no longer on the
> cfids->entries list, close_all_cached_dirs() cannot drop the dentry,
> leading to the unmount to report these BUGs:
>
> BUG: Dentry ffff88814f37e358{i=1000000000080,n=/}  still in use (2) [unmount of cifs cifs]
> VFS: Busy inodes after unmount of cifs (cifs)
> ------------[ cut here ]------------
> kernel BUG at fs/super.c:661!
>
> Flush anything in the cifsiod_wq workqueue in close_all_cached_dirs.
>
> Fixes: ebe98f1447bb ("cifs: enable caching of directories for which a lease is held")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Paul Aurich <paul@xxxxxxxxxxxxxx>
> ---
>  fs/smb/client/cached_dir.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/fs/smb/client/cached_dir.c b/fs/smb/client/cached_dir.c
> index de1e41abdaf2..931108b3bb4a 100644
> --- a/fs/smb/client/cached_dir.c
> +++ b/fs/smb/client/cached_dir.c
> @@ -482,10 +482,13 @@ void close_all_cached_dirs(struct cifs_sb_info *cifs_sb)
>                 list_for_each_entry(cfid, &cfids->entries, entry) {
>                         dput(cfid->dentry);
>                         cfid->dentry = NULL;
>                 }
>         }
> +
> +       /* Flush any pending lease breaks */
> +       flush_workqueue(cifsiod_wq);
>  }
>
>  /*
>   * Invalidate all cached dirs when a TCON has been reset
>   * due to a session loss.
> --
> 2.45.2
>
>


--
Thanks,

Steve





[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux