From b9d3485fb4e80ca302f3105a69f712b49846e2b6 Mon Sep 17 00:00:00 2001 From: Dmitry Chagin Date: Sat, 8 Jul 2017 21:08:22 +0000 Subject: [PATCH] Don't take a lock around atomic operation. MFC after: 3 weeks --- sys/fs/fdescfs/fdesc_vfsops.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sys/fs/fdescfs/fdesc_vfsops.c b/sys/fs/fdescfs/fdesc_vfsops.c index b8e0962c559..b933b571e83 100644 --- a/sys/fs/fdescfs/fdesc_vfsops.c +++ b/sys/fs/fdescfs/fdesc_vfsops.c @@ -123,7 +123,6 @@ static int fdesc_unmount(struct mount *mp, int mntflags) { struct fdescmount *fmp; - caddr_t data; int error, flags; flags = 0; @@ -148,15 +147,10 @@ fdesc_unmount(struct mount *mp, int mntflags) return (error); /* - * Finally, throw away the fdescmount structure. Hold the hashmtx to - * protect the fdescmount structure. + * Finally, throw away the fdescmount structure. */ - mtx_lock(&fdesc_hashmtx); - data = mp->mnt_data; mp->mnt_data = NULL; - mtx_unlock(&fdesc_hashmtx); - free(data, M_FDESCMNT); /* XXX */ - + free(fmp, M_FDESCMNT); return (0); }