Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3218202ybi; Mon, 10 Jun 2019 06:36:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqzcHIFcmi+uyYezmlpvAm5p1wL0rQNUpG4ixrdpMrbLKshyjJaGUHrZQlJ7m0JeB9H5m5Y3 X-Received: by 2002:a17:902:e409:: with SMTP id ci9mr70716210plb.103.1560173762026; Mon, 10 Jun 2019 06:36:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560173762; cv=none; d=google.com; s=arc-20160816; b=0ayl/kqvbENlhhnLBldn+3Lxh2fVdrJJtsZF+eeALr5Zyj6kpKX3lyuHlOfPj6pJOl 0b/+CUXbMHazE6O4YvCT49ihRLqwIxzrqzkvKoZ5e7SYT+Dc82qwWOWSKfzaGOP5Do51 VuIIdDPOnd68aKu54gSBXNPqX8OdKGLz5PaHYZPj1no82ngvhnn0DtWocS3OlnesnbEW ZnrblzCpdOGnynUPoGLKrIutsugfQ7gHZvVAsMffuIXn3AzDc6OMhnwfDQuE2z9aqmNT l6KzNUil4MdzSC2u+gH2jO831YFSkgZyW+yZgWYFt47vMY/YWwkZS4uyqAmCtdfFsxaY QFQA== 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; bh=WkrNbw0hNxqJxWtogtrxEjSqBjUQ8QhzHDVythsl3xs=; b=LO0gODYLGBRYQ9DemLe6myfRAPICqoydLI4/Bi3/0sSD8CjpzamY2NSHQ+k68l7omx z7YFGqQ4jsJjuf0uUaMG4AuyzDx7FddkCBoODcRMmk6+cwyRnYvZ/btCT+GqaGtxd4j4 UskOkQLneX1TRmkS5lPAqufVb1ikWQiuLd/43b8N2ch5c1EWqUAZc0/NL1lfZNW+afJw z3aQzjWRak6BlL2GqELJT+ynACvQhTy2rP+JC0DnAfrShy9mOCCxBmg7ZHZQURvpAjLB DPb74iPQ6ugEQhOsI+dnapa3LgBCo9uPjfvUr/hhAga0bx1Yv8CtiFTyM2/FZZtZMPDV 7p/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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 u38si9775418pgm.538.2019.06.10.06.35.42; Mon, 10 Jun 2019 06:36:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-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-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390254AbfFJNOd (ORCPT + 99 others); Mon, 10 Jun 2019 09:14:33 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:51506 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388848AbfFJNOd (ORCPT ); Mon, 10 Jun 2019 09:14:33 -0400 Received: from callcc.thunk.org ([66.31.38.53]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id x5ADEILt032203 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Jun 2019 09:14:18 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id E4DDE420481; Mon, 10 Jun 2019 09:14:17 -0400 (EDT) Date: Mon, 10 Jun 2019 09:14:17 -0400 From: "Theodore Ts'o" To: "Darrick J. Wong" Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 1/8] mm/fs: don't allow writes to immutable files Message-ID: <20190610131417.GD15963@mit.edu> References: <155552786671.20411.6442426840435740050.stgit@magnolia> <155552787330.20411.11893581890744963309.stgit@magnolia> <20190610015145.GB3266@mit.edu> <20190610044144.GA1872750@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190610044144.GA1872750@magnolia> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Sun, Jun 09, 2019 at 09:41:44PM -0700, Darrick J. Wong wrote: > On Sun, Jun 09, 2019 at 09:51:45PM -0400, Theodore Ts'o wrote: > > On Wed, Apr 17, 2019 at 12:04:33PM -0700, Darrick J. Wong wrote: > > > Shouldn't this check be moved before the modification of vmf->flags? > > It looks like do_page_mkwrite() isn't supposed to be returning with > > vmf->flags modified, lest "the caller gets surprised". > > Yeah, I think that was a merge error during a rebase... :( > > Er ... if you're still planning to take this patch through your tree, > can you move it to above the "vmf->flags = FAULT_FLAG_WRITE..." ? I was planning on only taking 8/8 through the ext4 tree. I also added a patch which filtered writes, truncates, and page_mkwrites (but not mmap) for immutable files at the ext4 level. I *could* take this patch through the mm/fs tree, but I wasn't sure what your plans were for the rest of the patch series, and it seemed like it hadn't gotten much review/attention from other fs or mm folks (well, I guess Brian Foster weighed in). What do you think? - Ted