From: Matthew Wilcox <willy@infradead.org>
To: Alex Shi <alex.shi@linux.alibaba.com>
Cc: linmiaohe@huawei.com, akpm@linux-foundation.org,
"Darrick J. Wong" <darrick.wong@oracle.com>,
Hugh Dickins <hughd@google.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [REF PATCH] mm/swap: fix swapon failure
Date: Mon, 9 Nov 2020 12:07:05 +0000 [thread overview]
Message-ID: <20201109120705.GZ17076@casper.infradead.org> (raw)
In-Reply-To: <1604922436-16597-1-git-send-email-alex.shi@linux.alibaba.com>
On Mon, Nov 09, 2020 at 07:47:16PM +0800, Alex Shi wrote:
> Go through the context I found the exit_swap_address_space(p->type)
> shouldn't be used in good result path. So just move it to error path.
But ... it's not used in the success path. There's a 'goto' right
before it. Does this really fix your problem?
> @@ -3339,7 +3339,8 @@ static bool swap_discardable(struct swap_info_struct *si)
> error = inode_drain_writes(inode);
> if (error) {
> inode->i_flags &= ~S_SWAPFILE;
> - goto free_swap_address_space;
> + exit_swap_address_space(p->type);
> + goto bad_swap_unlock_inode;
> }
>
> mutex_lock(&swapon_mutex);
> @@ -3364,8 +3365,6 @@ static bool swap_discardable(struct swap_info_struct *si)
>
> error = 0;
> goto out;
> -free_swap_address_space:
> - exit_swap_address_space(p->type);
> bad_swap_unlock_inode:
> inode_unlock(inode);
> bad_swap:
> --
> 1.8.3.1
>
>
next prev parent reply other threads:[~2020-11-09 12:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-09 11:47 Alex Shi
2020-11-09 12:07 ` Matthew Wilcox [this message]
2020-11-09 12:17 ` Alex Shi
2020-11-09 12:36 ` Alex Shi
2020-11-09 12:07 linmiaohe
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=20201109120705.GZ17076@casper.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=alex.shi@linux.alibaba.com \
--cc=darrick.wong@oracle.com \
--cc=hughd@google.com \
--cc=linmiaohe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/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