Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp752223ybz; Wed, 15 Apr 2020 18:11:04 -0700 (PDT) X-Google-Smtp-Source: APiQypKwqWFukvf77G8kU85bLSGaFdamGBpMxuBpkZG/yKCpckjUrZoZ+X/BlRRSY9WB0KHITKvr X-Received: by 2002:aa7:d1cf:: with SMTP id g15mr25620645edp.71.1586999464400; Wed, 15 Apr 2020 18:11:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586999464; cv=none; d=google.com; s=arc-20160816; b=FewYyBj0iJXcI7roHonUfQdwsb93vBjJ2bgc5IQ/UFpzqgaFQXhtXlifsIq/funWnq YMZXIA0el+C+dlVvvCoxJHtvgFKrMeJ5eg69dtIdsX6rqaH2rs+tBtXh7xFnlrcMUxK9 Q5a7GhkcJYOi7tTz8DIEhDRMkRFM6Tmh/13oSwDLwFoSBaBSizBp2L9lqtgS0T7gRC0f f3XlWy+Q8px5t4aomuLa2BKG9P9rfBUgM5hnZm6zvIhF9RQ+gO8GBl/l7ouIoRhbVGrS AH+keQSYazCYNGpv70YQeJA4Cx7szGEgXDYK8TAAREmIVRNjNu3DCrA5nA6TORznVx5B 06ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=o87sbTUV99GLgCFgslOAEpJns5hZ3TDfstO+3IfUwaQ=; b=uWjhaCFeWMke0LFSgByzz3kT8AO+1G1Ot/P356ouLHb93PpIywFNPgv8VYfS26fkCN b+7ImJY3KzFatUfb6WpuKux+sSxlxBmEzCDSiUpGb7MW66uwMMs2mOUsdfbCcDGiZhvY wOETwGrjRJZQZpx95hZJyH2hnwsQbvFvMWSu6x8f3S5tsEZ8nq6LQbDQkO2GUmnZIsVI ejoxZVVtd9MTeRIaE0cLqbzt1uTahK2VXp86jIgI2Cq7caqFJuy6CipJEgVwtCekCnTF flccROO84Mzrlol+2Py5vWkHQBt3ETfbvLmsQ1PSeH3XUO0IBYXOihOyQsdS8htdIQnC Lf6w== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f4si11012790ejf.337.2020.04.15.18.10.37; Wed, 15 Apr 2020 18:11:04 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730835AbgDOWIc (ORCPT + 99 others); Wed, 15 Apr 2020 18:08:32 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:48836 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728137AbgDOWIM (ORCPT ); Wed, 15 Apr 2020 18:08:12 -0400 Received: from callcc.thunk.org (pool-72-93-95-157.bstnma.fios.verizon.net [72.93.95.157]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 03FM7qjW008851 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Apr 2020 18:07:53 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id 5D5F642013D; Wed, 15 Apr 2020 18:07:52 -0400 (EDT) Date: Wed, 15 Apr 2020 18:07:52 -0400 From: "Theodore Y. Ts'o" To: Ira Weiny 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: <20200415220752.GA5187@mit.edu> References: <20200415174839.461347-1-tytso@mit.edu> <20200415202537.GA2309605@iweiny-DESK2.sc.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200415202537.GA2309605@iweiny-DESK2.sc.intel.com> 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 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. 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. 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. Have you tested your patch series to make sure we don't have some potential races here? - Ted