From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DATE_IN_PAST_06_12, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06861C4740A for ; Mon, 9 Sep 2019 22:17:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C519E2171F for ; Mon, 9 Sep 2019 22:17:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568067420; bh=eTPyePWV3IKKH2kJg7I/BE53B+fu/Ar+GJyFDi2phBw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=SbaHPgfA5jB1EtFH20O0vOLmvISiaG9IAi2vZzFJWGRq9qoulLDAZgPVKkGdq4YFY S9gkRZ7qP8OhomnfhWrzO0yb8l3Yk27JmgIY8YBItEz0tY1D+xEncRBSi8JMhWchn6 Ii8cWu6mPy11aiBjtpUfvl6axn+F7ob0DzmeO0eE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406288AbfIIWQ7 (ORCPT ); Mon, 9 Sep 2019 18:16:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:45678 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406226AbfIIWQs (ORCPT ); Mon, 9 Sep 2019 18:16:48 -0400 Received: from sasha-vm.mshome.net (unknown [62.28.240.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 93C9421D7D; Mon, 9 Sep 2019 22:16:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568067407; bh=eTPyePWV3IKKH2kJg7I/BE53B+fu/Ar+GJyFDi2phBw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iXDFmmD2nPCGjuE/78bjkJpqtaelHRRZYHRwfp5BgBSEzASh9pPM02bQOOX4xKRmb O0tHdVZ7tV230aN4eTHtRUXgUf2x1X1SNJvpx9JQxeSER9k2rdFkVZ/0LbfMfIjY1P eQqscBqyMcTzRqe6xE1LR1h5CEbdhReSlkoVyhWw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Al Viro , Christoph Hellwig , Sasha Levin Subject: [PATCH AUTOSEL 4.19 5/8] configfs_register_group() shouldn't be (and isn't) called in rmdirable parts Date: Mon, 9 Sep 2019 11:41:20 -0400 Message-Id: <20190909154124.31146-5-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190909154124.31146-1-sashal@kernel.org> References: <20190909154124.31146-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Al Viro [ Upstream commit f19e4ed1e1edbfa3c9ccb9fed17759b7d6db24c6 ] revert cc57c07343bd "configfs: fix registered group removal" It was an attempt to handle something that fundamentally doesn't work - configfs_register_group() should never be done in a part of tree that can be rmdir'ed. And in mainline it never had been, so let's not borrow trouble; the fix was racy anyway, it would take a lot more to make that work and desired semantics is not clear. Signed-off-by: Al Viro Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- fs/configfs/dir.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c index 809c1edffbaf1..19c8ce2a40430 100644 --- a/fs/configfs/dir.c +++ b/fs/configfs/dir.c @@ -1782,16 +1782,6 @@ void configfs_unregister_group(struct config_group *group) struct dentry *dentry = group->cg_item.ci_dentry; struct dentry *parent = group->cg_item.ci_parent->ci_dentry; - mutex_lock(&subsys->su_mutex); - if (!group->cg_item.ci_parent->ci_group) { - /* - * The parent has already been unlinked and detached - * due to a rmdir. - */ - goto unlink_group; - } - mutex_unlock(&subsys->su_mutex); - inode_lock_nested(d_inode(parent), I_MUTEX_PARENT); spin_lock(&configfs_dirent_lock); configfs_detach_prep(dentry, NULL); @@ -1806,7 +1796,6 @@ void configfs_unregister_group(struct config_group *group) dput(dentry); mutex_lock(&subsys->su_mutex); -unlink_group: unlink_group(group); mutex_unlock(&subsys->su_mutex); } -- 2.20.1