lkml.org 
[lkml]   [2020]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5] xfs: Fix false positive lockdep warning with sb_internal & fs_reclaim
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.

-Dave.
--
Dave Chinner
david@fromorbit.com

\
 
 \ /
  Last update: 2020-07-03 03:08    [W:0.071 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site