From: Waiman Long <longman@redhat.com>
To: Dave Chinner <david@fromorbit.com>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>,
linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
Qian Cai <cai@lca.pw>, Eric Sandeen <sandeen@redhat.com>
Subject: Re: [PATCH v5] xfs: Fix false positive lockdep warning with sb_internal & fs_reclaim
Date: Thu, 2 Jul 2020 23:05:10 -0400 [thread overview]
Message-ID: <85cbaacf-6986-d363-5c80-530be9a6fa63@redhat.com> (raw)
In-Reply-To: <20200703010720.GH5369@dread.disaster.area>
On 7/2/20 9:07 PM, Dave Chinner wrote:
> On Wed, Jul 01, 2020 at 08:59:23PM -0400, Waiman Long wrote:
>> Suggested-by: Dave Chinner <david@fromorbit.com>
>> Signed-off-by: Waiman Long <longman@redhat.com>
>> ---
>> fs/xfs/xfs_super.c | 12 +++++++++++-
>> 1 file changed, 11 insertions(+), 1 deletion(-)
>>
>> diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
>> index 379cbff438bc..dcc97bad950a 100644
>> --- a/fs/xfs/xfs_super.c
>> +++ b/fs/xfs/xfs_super.c
>> @@ -913,11 +913,21 @@ xfs_fs_freeze(
>> struct super_block *sb)
>> {
>> struct xfs_mount *mp = XFS_M(sb);
>> + unsigned long pflags;
>> + int ret;
>>
>> + /*
>> + * Disable fs reclaim in memory allocation for fs freeze to avoid
>> + * causing a possible circular locking dependency lockdep splat
>> + * relating to fs reclaim.
>> + */
> /*
> * The filesystem is now frozen far enough that memory reclaim
> * cannot safely operate on the filesystem. Hence we need to
> * set a GFP_NOFS context here to avoid recursion deadlocks.
> */
>
>> + current_set_flags_nested(&pflags, PF_MEMALLOC_NOFS);
> memalloc_nofs_save/restore(), please.
Thanks for the comments, I will make the suggested change.
Cheers,
Longman
prev parent reply other threads:[~2020-07-03 3:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-02 0:59 [PATCH v5] xfs: Fix false positive lockdep warning with sb_internal & fs_reclaim Waiman Long
2020-07-03 1:07 ` Dave Chinner
2020-07-03 3:05 ` Waiman Long [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=85cbaacf-6986-d363-5c80-530be9a6fa63@redhat.com \
--to=longman@redhat.com \
--cc=cai@lca.pw \
--cc=darrick.wong@oracle.com \
--cc=david@fromorbit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@redhat.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;
as well as URLs for NNTP newsgroup(s).