Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp914741ybz; Wed, 15 Apr 2020 22:24:30 -0700 (PDT) X-Google-Smtp-Source: APiQypIABN5tduMsG/PorFoVVDLBJNyTU+D+ePhxQoNgwqOJWt7b7j0xjDMzQnjzS4eBCOBNN/7X X-Received: by 2002:a50:a68a:: with SMTP id e10mr28891439edc.317.1587014669915; Wed, 15 Apr 2020 22:24:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587014669; cv=none; d=google.com; s=arc-20160816; b=RQvYVQ+Xf2nG28o1JlUjhbcWfALTg4F32YguWZtxP2nSTbkypwOcPDHW52h0dz68LS FGJ+08H3UzKcVACTt+xWle7jeCN1y5zSczYXGizsUQPJSlvuTWNGS2mGpmVbzBGYIhbA KdrowA+Im+vHlHAYD2uehBwlBkctuRCzvKDczG2jUIKEVRS5WzSrzW74PnPXRFqlizBS Ann+IpQW43ynJS3ksacAb7uLVElQx1H/ZK3Aptq70aQvRj1I9pCUz+98zWLZ2Q5UNsC7 S2Ja/HQvcC/zdlNS0QGh/5aMBu4M4x4iN8rOvnNkxl3b7hjDQHBSvklbuUW2tXblzrDi wPTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=+vVtLSFNN/ph/z7SYwjq3oHJqfyao4G/RhfkCxgBUqw=; b=M9cdeThCpWrS5zttYMsfnE3QVraUvtf8clfRR8O/fQQGW3x8Qg/VlPLMMiCeq6jJ2g JKzsPGy+MxtqxgfLPlGDvMNpypilxZLSRkWPqzmffi3o29xbzCHgN5wV1Ad7jZ51ZNZR QvPGLmKl69d9gz5kUzJGc6Z8f8jZzvwinJMspvp5fDXrX2R8unOpDXOla3SrutoAqoAC /QDYPH+vqg4ayfUnRXeqc3TtTQ2XKi7aoQzB+Bk5G4H8cuXoeU67X2XJszq1ceEZSHjG z8l3/BbG20I+mYF5tMsRIh0feYOlWIrMcKMwilnsf9X1EtOyDO2ZI5HutlVLCW2OUbx8 itRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g22si11650506ejr.228.2020.04.15.22.23.56; Wed, 15 Apr 2020 22:24:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406330AbgDPFXz (ORCPT + 99 others); Thu, 16 Apr 2020 01:23:55 -0400 Received: from mga05.intel.com ([192.55.52.43]:6837 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405910AbgDPFXx (ORCPT ); Thu, 16 Apr 2020 01:23:53 -0400 IronPort-SDR: FK3thNlWBt6+WeqlTTXai4I0xWy1ke8jWz5WVN+VpZMp9NDSjvikiGodOsIgNpASNLl3INaTIe ATbARqIo2uwA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2020 22:23:52 -0700 IronPort-SDR: rkCDxqxZmGSqcrVnf5Ntz9YJRC2ApVIcAvDj/Ck5gP0nfv9pEoOzL//5n+GVxKipAlQ9NV6SEM JME5fDDhl1+w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,388,1580803200"; d="scan'208";a="299200879" Received: from iweiny-desk2.sc.intel.com ([10.3.52.147]) by FMSMGA003.fm.intel.com with ESMTP; 15 Apr 2020 22:23:52 -0700 Date: Wed, 15 Apr 2020 22:23:52 -0700 From: Ira Weiny To: "Theodore Y. Ts'o" Cc: Ext4 Developers List , syzkaller-bugs@googlegroups.com, stable@kernel.org, syzbot+bca9799bf129256190da@syzkaller.appspotmail.com Subject: Re: [PATCH] ext4: reject mount options not supported when remounting in handle_mount_opt() Message-ID: <20200416052352.GK2309605@iweiny-DESK2.sc.intel.com> References: <20200415174839.461347-1-tytso@mit.edu> <20200415202537.GA2309605@iweiny-DESK2.sc.intel.com> <20200415220752.GA5187@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200415220752.GA5187@mit.edu> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Apr 15, 2020 at 06:07:52PM -0400, Theodore Y. Ts'o wrote: > On Wed, Apr 15, 2020 at 01:25:37PM -0700, Ira Weiny wrote: > > This fundamentally changes the behavior from forcing the dax mode to be the > > same across the remount to only failing if we are going from non-dax to dax, > > adding -o dax on the remount? > > > > But going from -o dax to 'not -o dax' would be ok? > > > > FWIW after thinking about it some I _think_ it would be ok to allow the dax > > mode to change on a remount and let the inodes in memory stay in the mode they > > are at. And newly loaded inodes would get the new mode... Unfortunately > > without the STATX patch I have proposed the user does not have any way of > > knowing which files are in which mode. > > We don't currently support mount -o nodax. But we do support not supplying the option which means 'nodax' right? > So the intention of the > current code is that the dax mode can't change in either direction > (enabling or disabling) as a remount option. > > The syzkaller report was because changing dax mode racing with other > operations given the current code base, could result in a kernel OOPS. > So we *do* need to rule it out at least for now. But does this new patch prevent a dax change from '-o dax' to not specifying the option? I admit this option parsing code is confusing me. So I might be missing it completely. > > I certainly don't object to allowing changing dax mode as a remount > --- so long as we have tests to make sure that if we stress opening, > reading, writing, mmap'ing files, etc., while another thread is > flipping back and forth between dax=never and dax=always is mount -o > remount --- and make sure that we don't end up crashing. > > And this test needs to be in xfstests, because trying to figure out > what triggers a syzkaller failures in file system land is a pain in > the *ss so we really want a dedicated xfstests for this case. Agreed. > Have > you tested your patch series to make sure we don't have some potential > races here? No, I've not anticipated the potential of this until today... :-D Ira