From: Miaohe Lin <linmiaohe@huawei.com>
To: Christoph Hellwig <hch@infradead.org>
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>, <louhongxiang@huawei.com>,
<linfeilong@huawei.com>, liubo <liubo254@huawei.com>
Subject: Re: [PATCH v2 2/2] mm/swapfile: release swap info when swap device is unpluged
Date: Thu, 16 Jun 2022 15:00:24 +0800 [thread overview]
Message-ID: <94b554c5-50cc-141c-c494-14005425930a@huawei.com> (raw)
In-Reply-To: <YqnA+nZzkPYsw6CI@infradead.org>
On 2022/6/15 19:22, Christoph Hellwig wrote:
> 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
When swap device is unplugged, the swap_file->f_path.dentry will be in the
d_unlinked() status. Could we use it to detect the problem instead? IMHO, we
can found the unplugged swap devices this way and further get the right swap
device to swapoff through comparing the swap device name with @specialfile.
Or am I miss something?
> not sure what would be a good handle here.
Using handle sounds like a good idea too. :) But can the above solution be acceptable?
> .
>
Thanks!
prev parent reply other threads:[~2022-06-16 7:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-15 7:02 [PATCH v2 0/2] " liubo
2022-06-15 7:02 ` [PATCH v2 1/2] mm/swapfile: Extract operations of resource release in the swapoff process liubo
2022-06-15 7:02 ` [PATCH v2 2/2] mm/swapfile: release swap info when swap device is unpluged liubo
2022-06-15 11:22 ` Christoph Hellwig
2022-06-16 7:00 ` Miaohe Lin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=94b554c5-50cc-141c-c494-14005425930a@huawei.com \
--to=linmiaohe@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=hch@infradead.org \
--cc=linfeilong@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liubo254@huawei.com \
--cc=louhongxiang@huawei.com \
--cc=minchan@kernel.org \
--cc=naoya.horiguchi@nec.com \
--cc=neilb@suse.de \
--cc=peterx@redhat.com \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
--cc=willy@infradead.org \
--cc=ying.huang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox