Skip to content

cifs: fix "Busy inodes after umount" issues (RFC)

Jeff Layton linux-fsdevel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4cifs: make cifs_lookup return a dentryfs/cifs/dir.c+9 -46 replies
2/4cifs: don't leave open files danglingfs/cifs/dir.c+6 -52 replies
3/4cifs: move cifs_new_fileinfo call out of cifs_posix_openfs/cifs/cifsproto.h fs/cifs/dir.c fs/cifs/file.c+27 -292 replies
4/4cifs: pass instantiated filp back after open callfs/cifs/dir.c fs/cifs/file.c+28 -500 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] cifs: fix "Busy inodes after umount" issues (RFC)

We've had a spate of "Busy inodes after umount" problems in recent kernels. With the help of a reproducer that Suresh provided, I tracked down the cause of one of these and wrote it up here:

    https://bugzilla.samba.org/show_bug.cgi?id=7433

The main problem is that CIFS opens files during create operations, puts these files on a list and then expects that a subsequent open operation will find those on the list and make them full, productive members of society.

This expectation is wrong however. There's no guarantee that cifs_open will be called at all after a create. There are several scenarios that can prevent it from occuring. When this happens, these entries get left dangling on the list and nothing will ever clean them up. Recent changes have made it so that cifsFileInfo structs hold an inode reference as well, which is what actually leads to the busy inodes after umount problems.

This patch is intended to fix this in the right way. It has the create operations properly use lookup_instantiate_filp to create an open file during the operation that does the actual create. With this, there's no need to have cifs_open scrape these entries off the list.

This fixes the busy inodes problem I was able to reproduce. It's not very well tested yet however, and I could stand for someone else to review it and help test it.

Jeff Layton (4):
cifs: make cifs_lookup return a dentry
cifs: don't leave open files dangling
cifs: move cifs_new_fileinfo call out of cifs_posix_open
cifs: pass instantiated filp back after open call

 fs/cifs/cifsproto.h |    1 -
 fs/cifs/dir.c       |   88 ++++++++++++++++++++++++++++++---------------------
 fs/cifs/file.c      |   59 +++++++--------------------------
 3 files changed, 65 insertions(+), 83 deletions(-)