Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6573392ybx; Mon, 11 Nov 2019 11:10:14 -0800 (PST) X-Google-Smtp-Source: APXvYqwfyZE7qjG8UgLX4VGDIFYB7sodPDhgyFAWQSNG8Z/e6VsMAqDiZobY4OqO8c5yzSxet3fX X-Received: by 2002:aa7:c39a:: with SMTP id k26mr12923402edq.128.1573499408748; Mon, 11 Nov 2019 11:10:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573499408; cv=none; d=google.com; s=arc-20160816; b=PWei5MyrYLVkwPfk6xqTBdnr48UDc2TpN/W27CTcnbOhYzxAtgBDRIJsS8WMuqFNKO tQDZjrCgYtj3TNplhhVvxaxeFOM9dx5Q9j04hCBpHAmXAyi/b/WUl7R99we6Z5mEP2uR f2H9MU52dhvsLB2lFES6QXUa35DRqKh5ediGvZpsUyP5yE/XYf4JTPjUZazT3gUdv2wK m0ZZti/OfykCch8YwJ7AGr5rnoHcN2+7Xjo0nLo4JsEPGggwxUWSzuPNUrKTiJC8SpLZ PGZmn2cbBkdri6aw1nWq3aCMjCTYZmUSLDJSJeDwpMINvSDSU+dyeEd4DC66YN4Zwrya Y7Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=r5JAGlSm2zRORwdpFcxWMUkYid+J+rjkdb0zdAVauvk=; b=TS0F5uugAO1dG88C2KQ9rn4YbyVW9Qb1r74uNpTQzlSSAHebWWRp0M5Ml56TnZdog+ j36GQPlQlLrI993+8ZHr9W7H0i8Ubc6qzNCZK51WTmQJkpm5X/xiYpiRbWkmlfwlo5cV lh1H6+82v0wF54/0rCjLz51GynxIU3NXs3GLSOT1u6b7kA6G6Up0P+ks7BAWKCQ3svel R8+DWgtX5lznnDinCZ3xCzM/DLY3OfAdWFXH2CK4f6U7MxT+IvTa38otcr55rE92s8Iy 7SWMMnElUBIAKr4pOV3JMDU1kZCYn93vG0NVSg2j46gfJEBzlqRyjGetG9j9PNP0hctS Fjww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=D49QMJeo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a11si14639943edj.143.2019.11.11.11.09.44; Mon, 11 Nov 2019 11:10:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=D49QMJeo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728056AbfKKTHJ (ORCPT + 99 others); Mon, 11 Nov 2019 14:07:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:56818 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727987AbfKKSiB (ORCPT ); Mon, 11 Nov 2019 13:38:01 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0845F214E0; Mon, 11 Nov 2019 18:37:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573497480; bh=ZK/ZBjuL36PlHFysUhKmPHj4iSBscDJgj7PWaoy0ufo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D49QMJeoipL2EJdhrE4SVxCij8++3Dd2PYOswjJFjer+T53qKqJXbmICH6f45befI znIIH1Q317XAhTlFK4SOx+hW0edMsjoru7IWR65YuEKFc6a2+xqWYBwh4rop1RBzPD seCxZlxLpro5ttKiW9C4sdO1sKs7GY/XoqzzqB1U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Al Viro , Christoph Hellwig Subject: [PATCH 4.14 042/105] configfs_register_group() shouldnt be (and isnt) called in rmdirable parts Date: Mon, 11 Nov 2019 19:28:12 +0100 Message-Id: <20191111181440.718616654@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111181421.390326245@linuxfoundation.org> References: <20191111181421.390326245@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 commit f19e4ed1e1edbfa3c9ccb9fed17759b7d6db24c6 upstream. 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: Greg Kroah-Hartman --- fs/configfs/dir.c | 11 ----------- 1 file changed, 11 deletions(-) --- a/fs/configfs/dir.c +++ b/fs/configfs/dir.c @@ -1782,16 +1782,6 @@ void configfs_unregister_group(struct co 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 co dput(dentry); mutex_lock(&subsys->su_mutex); -unlink_group: unlink_group(group); mutex_unlock(&subsys->su_mutex); }