Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7654129ybi; Thu, 1 Aug 2019 11:31:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqz2tBI+F15eq55oOo4e7zefgRLuOAG8rCq6G+QQ+xB7dOLFE0CQpc3VBVdFD/ozRO76hThE X-Received: by 2002:a17:902:3103:: with SMTP id w3mr3793976plb.84.1564684297288; Thu, 01 Aug 2019 11:31:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564684297; cv=none; d=google.com; s=arc-20160816; b=y6yo0lCe2//m5ofNIodOlRsrpuASotj/I3+3lDrd7H29srnYaSLenTQ35wwHL6oCMV tkQFaVIAxCKJ92dieySgg6nfA/MaUoHfYeg26LfAotLbvtKAqjovIGS4zv9yd9jCgBFI RlmKNJs3kU6ybvm4wZGvziZQ1+RF4KM/gv/jAFJKDUuLKZC6zFtK7Zt5fThoYkt0I6Dv AYXY8P8yLnIvVNAunmXxF9YFifmXtb+VuJhyE6F4JciM56MV/ASljtQAotTU5/ORuC0y sOVHCRrLMse/MjMPAtxurRT8kKPKw7uuUuXGxwz71GgMtcji8iaIqP4GD5AScvqhUMAz 6Jew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:user-agent:message-id :references:cc:in-reply-to:from:to:content-transfer-encoding :mime-version; bh=1URBhdptd4fVOOD0NW2DdZS1yBfOaHDQqNLoEn65QtU=; b=0ZC+Acs/2uT1d+1dQqKJGwr6Lhg5a14GsF/25oqQb5MPS6oK26s3/NbJvmGACfNrRX Oh3pcGGu4u6n7gOD1lmZ8f1AntZdHFf2MXUXZeGMBvmiePQVdIY8c7furYRA00gbKRhh HjpeN/9YKSNxdZfH/Omf7/oSqT8W5ey+IDTQXbLZQ6KrPkjiXNBao5v9ERO38etMLpqW nIMqjkLADPuBH8hbGauLvkO5d0Xz9M35PTfjAGQXRNJwSxCb2U9la8n4cUtnmdRZSwrN dtmjF6IE4/EfsFeyM3pRIfD2wph78JSn0NzRgORyPRRztlggDpd4/iabPUgGPowm6DJs Bo+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y7si35870073pgi.401.2019.08.01.11.31.21; Thu, 01 Aug 2019 11:31:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727482AbfHARbH convert rfc822-to-8bit (ORCPT + 99 others); Thu, 1 Aug 2019 13:31:07 -0400 Received: from mail.fireflyinternet.com ([109.228.58.192]:52080 "EHLO fireflyinternet.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726118AbfHARbH (ORCPT ); Thu, 1 Aug 2019 13:31:07 -0400 X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from localhost (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP (TLS) id 17794926-1500050 for multiple; Thu, 01 Aug 2019 18:30:47 +0100 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT To: Sergey Senozhatsky From: Chris Wilson In-Reply-To: <20190731164829.GA399@tigerII.localdomain> Cc: 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 References: <20190721142930.GA480@tigerII.localdomain> <20190731164829.GA399@tigerII.localdomain> Message-ID: <156468064507.12570.1311173864105235053@skylake-alporthouse-com> User-Agent: alot/0.6 Subject: Re: [Intel-gfx] [linux-next] mm/i915: i915_gemfs_init() NULL dereference Date: Thu, 01 Aug 2019 18:30:45 +0100 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Sergey Senozhatsky (2019-07-31 17:48:29) > @@ -36,19 +38,35 @@ int i915_gemfs_init(struct drm_i915_private *i915) > struct super_block *sb = gemfs->mnt_sb; > /* FIXME: Disabled until we get W/A for read BW issue. */ > char options[] = "huge=never"; > - int flags = 0; > int err; > > - err = sb->s_op->remount_fs(sb, &flags, options); > - if (err) { > - kern_unmount(gemfs); > - return err; > - } > + fc = fs_context_for_reconfigure(sb->s_root, 0, 0); > + if (IS_ERR(fc)) > + goto err; > + > + 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. > + 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. 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. Looks like the API is already available in dinq, so we can apply this ahead of the next merge window. -Chris