]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: release cached dentries only if mount is complete
authorShyam Prasad N <sprasad@microsoft.com>
Fri, 1 Apr 2022 06:25:17 +0000 (06:25 +0000)
committerSteve French <stfrench@microsoft.com>
Fri, 8 Apr 2022 14:03:43 +0000 (09:03 -0500)
commitb20b1af6aab8fb5bc77fde8a2e8ddfb78946c962
tree35fb1105dc8bb11bc3258da3fa3f66f26d1cdbff
parentd4b76505883b8e7fa34e19cd36298e3415d95f63
cifs: release cached dentries only if mount is complete

During cifs_kill_sb, we first dput all the dentries that we have cached.
However this function can also get called for mount failures.
So dput the cached dentries only if the filesystem mount is complete.
i.e. cifs_sb->root is populated.

Fixes: 07db69f9a9ac ("cifs: Grab a reference for the dentry of the cached directory during the lifetime of the cache")
Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/cifsfs.c