From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergey Senozhatsky Subject: Re: [Intel-gfx] [linux-next] mm/i915: i915_gemfs_init() NULL dereference Date: Fri, 2 Aug 2019 14:37:20 +0900 Message-ID: <20190802053720.GA3838@jagdpanzerIV> References: <20190721142930.GA480@tigerII.localdomain> <20190731164829.GA399@tigerII.localdomain> <156468064507.12570.1311173864105235053@skylake-alporthouse-com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <156468064507.12570.1311173864105235053@skylake-alporthouse-com> Sender: linux-kernel-owner@vger.kernel.org To: Chris Wilson Cc: Sergey Senozhatsky , David Airlie , intel-gfx@lists.freedesktop.org, Hugh Dickins , linux-kernel@vger.kernel.org, David Howells , linux-mm@kvack.org, dri-devel@lists.freedesktop.org, Andrew Morton List-Id: intel-gfx@lists.freedesktop.org On (08/01/19 18:30), Chris Wilson wrote: > Quoting Sergey Senozhatsky (2019-07-31 17:48:29) > > @@ -36,19 +38,35 @@ int i915_gemfs_init(struct drm_i915_private *i915) [..] > > + if (!fc->ops->parse_monolithic) > > + goto err; > > + > > + err = fc->ops->parse_monolithic(fc, options); > > + if (err) > > + goto err; > > + > > + if (!fc->ops->reconfigure) > > It would be odd for fs_context_for_reconfigure() to allow creation of a > context if that context couldn't perform a reconfigre, nevertheless that > seems to be the case. Well, I kept those checks just because fs/ code does the same. E.g. fs/super.c reconfigure_super() { if (fc->ops->reconfigure) fc->ops->reconfigure(fc) } do_emergency_remount_callback() { fc = fs_context_for_reconfigure(); reconfigure_super(fc); } > > + goto err; > > + > > + err = fc->ops->reconfigure(fc); > > + if (err) > > + goto err; > > Only thing that stands out is that we should put_fs_context() here as > well. Oh... Indeed, somehow I forgot to put_fs_context(). > I guess it's better than poking at the SB_INFO directly ourselves. > I think though we shouldn't bail if we can't change the thp setting, and > just accept whatever with a warning. OK. > Looks like the API is already available in dinq, so we can apply this > ahead of the next merge window. OK, will cook a formal patch then. Thanks! -ss