Re: [PATCH] Revert "cifs: remove all cifs files before kill super"
Namjae Jeon <[email protected]>
| Newsgroups | gmane.linux.kernel,gmane.linux.kernel.cifs,gmane.network.samba.internals |
|---|---|
| Message-ID | <CAKYAXd8R5W+-NVp0Mkqr2XcYoq70jKwvsefF9Bviu00xWh140w@mail.gmail.com> |
On Tue, Aug 18, 2026 at 12:13 PM Zizhi Wo <[email protected]> wrote: > > From: Zizhi Wo <[email protected]> > > This reverts commit 6d9a4aaaa8b2612b5ef9d581e2f286a458b71ee1. > > First, directly flushing fileinfo_put_wq in that commit cannot guarantee > that all in-flight I/O has run its cleanup_work on system_dfl_wq and > subsequently called queue_work(fileinfo_put_wq, ...). Flushing only the > latter workqueue may therefore miss puts that have not yet been queued, so > the fix is not reliable in the first place. Moreover, this fix flushes > inside cifs_umount(), which means the busy-dentry warning can still be > triggered when umount_check() is called inside kill_anon_super(), because > kill_anon_super() is executed before cifs_umount(). > > Second, commit 75f5c412fa86 ("smb: client: fix busy dentry warning on > unmount after DIO") already drains both serverclose_wq and fileinfo_put_wq > in cifs_kill_sb(), before kill_anon_super(). By adding a per-superblock > outstanding-rreq counter, it guarantees that all cleanup_work for this sb > have run, and thus all relevant cfile puts are queued on fileinfo_put_wq > or serverclose_wq. > > Third, no path between those drains and cifs_umount() can queue new work > onto either workqueue. In the "cifs_sb->root == NULL" path there are no > file-related workers either, so that case is safe as well. > > Therefore the busy-dentry and null-ptr-deref problems cannot arise, and > the flush added by commit 6d9a4aaaa8b2 ("cifs: remove all cifs files before > kill super") is redundant and can be removed. > > Signed-off-by: Zizhi Wo <[email protected]> Will apply it to #for-next. Thanks!