From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2388DC432C0 for ; Thu, 28 Nov 2019 15:45:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EEC77217BA for ; Thu, 28 Nov 2019 15:45:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="lYn5QAbb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726641AbfK1PpX (ORCPT ); Thu, 28 Nov 2019 10:45:23 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:57104 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726569AbfK1PpX (ORCPT ); Thu, 28 Nov 2019 10:45:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=1Ua9kzhqWdT/XmuB+JkZPQ/zR7CbGzhbDxmS9/PUHRg=; b=lYn5QAbbuOgCVzO0wK72zGcGg mQTVtUtKdl4KYiJHp4I5I3FXK/6FWZhfra4tUuTFV7QC78oDUm8NKzHIrgasl+8sbPlrCdG0T67u3 kgAQ57kaMp3R3h1Z+mwXZn4SMTDknO5FcjPcWJhT6kEGYu4yyJ+8h7G98UfdWJKrqUQljjAF2xpQv RhfjlbJLk4dNosXzbNYjYOLiCEP2PZWfBnLjpu5EMP/cgJOBC3HTYk0zTcErIw08z7ffMbdnD/r09 tSSlveUJqScNNE8ME81M1Rd4A954YOsGafxeRRIk7ktZ64V53SmN+UKMgMG5kfHDds764Ihn7lkwx SsNl980Fw==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1iaLym-0005vg-OI; Thu, 28 Nov 2019 15:45:16 +0000 Date: Thu, 28 Nov 2019 07:45:16 -0800 From: Christoph Hellwig To: "Darrick J. Wong" Cc: Andreas Gruenbacher , Linus Torvalds , linux-kernel@vger.kernel.org, Alexander Viro , Jeff Layton , Sage Weil , Ilya Dryomov , Theodore Ts'o , Andreas Dilger , Jaegeuk Kim , Chao Yu , Christoph Hellwig , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Richard Weinberger , Artem Bityutskiy , Adrian Hunter , ceph-devel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.org Subject: Re: [PATCH] fs: Fix page_mkwrite off-by-one errors Message-ID: <20191128154516.GA17166@infradead.org> References: <20191127151811.9229-1-agruenba@redhat.com> <20191127154954.GT6219@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191127154954.GT6219@magnolia> User-Agent: Mutt/1.12.1 (2019-06-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Nov 27, 2019 at 07:49:54AM -0800, Darrick J. Wong wrote: > On Wed, Nov 27, 2019 at 04:18:11PM +0100, Andreas Gruenbacher wrote: > > Fix a check in block_page_mkwrite meant to determine whether an offset > > is within the inode size. This error has spread to several filesystems > > and to iomap_page_mkwrite, so fix those instances as well. > > Seeing how this has gotten screwed up at least six times in the kernel, > maybe we need a static inline helper to do this for us? Yes. I think we really want a little helper that checks the mapping and the offset. That also gives us the opportunity to document the semantics. > > > Signed-off-by: Andreas Gruenbacher > > The iomap part looks ok, > Reviewed-by: Darrick J. Wong > > (I might just extract the iomap part and put it in the iomap tree if > someone doesn't merge this one before I get to it...) I think we should just pull in the helper and conversions through some tree after all iomap bits are merged. It might as well be the iomap tree as that seems to the place for file system read/write infrastructure these days.