[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180409134114.GA30963@bombadil.infradead.org>
Date: Mon, 9 Apr 2018 06:41:14 -0700
From: Matthew Wilcox <willy@...radead.org>
To: Michal Hocko <mhocko@...nel.org>
Cc: Chao Yu <yuchao0@...wei.com>, Minchan Kim <minchan@...nel.org>,
Jaegeuk Kim <jaegeuk@...nel.org>,
Christopher Lameter <cl@...ux.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-mm <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>,
Johannes Weiner <hannes@...xchg.org>, Jan Kara <jack@...e.cz>,
Chris Fries <cfries@...gle.com>,
linux-f2fs-devel@...ts.sourceforge.net,
linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH] mm: workingset: fix NULL ptr dereference
On Mon, Apr 09, 2018 at 02:48:52PM +0200, Michal Hocko wrote:
> On Mon 09-04-18 20:25:06, Chao Yu wrote:
> [...]
> > diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
> > index c85cccc2e800..cc63f8c448f0 100644
> > --- a/fs/f2fs/inode.c
> > +++ b/fs/f2fs/inode.c
> > @@ -339,10 +339,10 @@ struct inode *f2fs_iget(struct super_block *sb, unsigned long ino)
> > make_now:
> > if (ino == F2FS_NODE_INO(sbi)) {
> > inode->i_mapping->a_ops = &f2fs_node_aops;
> > - mapping_set_gfp_mask(inode->i_mapping, GFP_F2FS_ZERO);
> > + mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS);
>
> An unrelated question. Why do you make all allocations for the mapping
> NOFS automatically? What kind of reclaim recursion problems are you
> trying to prevent?
It's worth noting that this is endemic in filesystems.
$ git grep mapping_set_gfp_mask.*FS
drivers/block/loop.c: mapping_set_gfp_mask(mapping, lo->old_gfp_mask & ~(__GFP_IO|__GFP_FS));
fs/btrfs/disk-io.c: mapping_set_gfp_mask(fs_info->btree_inode->i_mapping, GFP_NOFS);
fs/f2fs/inode.c: mapping_set_gfp_mask(inode->i_mapping, GFP_F2FS_ZERO);
fs/f2fs/inode.c: mapping_set_gfp_mask(inode->i_mapping, GFP_F2FS_ZERO);
fs/gfs2/glock.c: mapping_set_gfp_mask(mapping, GFP_NOFS);
fs/gfs2/ops_fstype.c: mapping_set_gfp_mask(mapping, GFP_NOFS);
fs/jfs/jfs_imap.c: mapping_set_gfp_mask(ip->i_mapping, GFP_NOFS);
fs/jfs/super.c: mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS);
fs/nilfs2/gcinode.c: mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS);
fs/nilfs2/page.c: mapping_set_gfp_mask(mapping, GFP_NOFS);
fs/reiserfs/xattr.c: mapping_set_gfp_mask(mapping, GFP_NOFS);
fs/xfs/xfs_iops.c: mapping_set_gfp_mask(inode->i_mapping, (gfp_mask & ~(__GFP_FS)));
Powered by blists - more mailing lists