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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D83EC43334 for ; Wed, 15 Jun 2022 11:23:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344745AbiFOLXE (ORCPT ); Wed, 15 Jun 2022 07:23:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345394AbiFOLWx (ORCPT ); Wed, 15 Jun 2022 07:22:53 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAFDBDECB for ; Wed, 15 Jun 2022 04:22:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=FVOq6VwUFB6uFGq2mjk/V+n5h8ZD55Qbyk92hCokle4=; b=x516N7q+S0IoRntqx03R881c4L aUG+uFkvQ2ZlReI5wNvc3O80OwY0bHH/Osdpk+MWHqf7L63nQRiXo2EB1VMhezaoXeiTgFhHWNt3l yXaJIiZxCiccJ2PMKZxsADdC98aBEj9YWBXFPZlVhenBNO1bd/bYR+0KSgRznX/okKIfkjpW4MF/7 glQ64v59zGHQI2ESvlEk8pPQI4RRfnhRl+ExqjqgtKeaDDVcyWDmBXt/ta8YxblMZuthaANolD81f jIZJiqrZdO0GdFNG68XLUjEfeykpZLcoFEtdcO1rsQzWa6AwI6Z9Gduqytf26S9XofgafjQXlpBoE xTElzBnw==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1R6Y-00E9Kf-OK; Wed, 15 Jun 2022 11:22:34 +0000 Date: Wed, 15 Jun 2022 04:22:34 -0700 From: Christoph Hellwig To: liubo Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, ying.huang@intel.com, willy@infradead.org, vbabka@suse.cz, surenb@google.com, peterx@redhat.com, neilb@suse.de, naoya.horiguchi@nec.com, minchan@kernel.org, linmiaohe@huawei.com, louhongxiang@huawei.com, linfeilong@huawei.com Subject: Re: [PATCH v2 2/2] mm/swapfile: release swap info when swap device is unpluged Message-ID: References: <20220615070228.2858170-1-liubo254@huawei.com> <20220615070228.2858170-3-liubo254@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220615070228.2858170-3-liubo254@huawei.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sorry, but this is simply broken. We can't just do d_path magic here. That being said the problem is real, and I think the right answer is to offer a swapoff variant that doesn't need to open the underlying device or file, but useѕ some kind of handle. I'm just not sure what would be a good handle here.