Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5551534ybe; Tue, 10 Sep 2019 05:38:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQ/Gb4lfowIXPW08riwM44uF0cBvy3RrZEO1XeujWWrbb2HNd9+Fd4rWyKF8euKkRX8La2 X-Received: by 2002:aa7:c542:: with SMTP id s2mr30650377edr.32.1568119091669; Tue, 10 Sep 2019 05:38:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568119091; cv=none; d=google.com; s=arc-20160816; b=AF48qdl7d5hTciZ1QN94X1bYoJ7S6MY1rixgUfswj92BQP13Z5bXYNcWBW/iAmiYHR k+K4kxyK63Z2vvh2jq6AV6TIBopV3d1J/ZFw406xg5GTguh+ZKAOXHpRg2ukSrHdoQbP jKJcC/CLBIoGEOU85zeFpgjmD7F0ACHG/o8HNQEKnTiH8dsa8xUQ4HQwBlzH5NpOh8I+ Cklf5p1p2Ol8OYSr+6AiH09XPqSZ6ba/jKJiHbwzU28+f0W/LmhcndDSVeVlL8oQIyTC NNyUXhUgOG1Xx+3OkhPXzvVLQZXAg59tHYX0a+dgSEH881h+mIFbVotrJWvxyQKtk4W5 UL1w== 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:dkim-signature; bh=xlKn3ut4vJcecpSFo5ylYLz+gUFXNHMgr09jHtOfi9Q=; b=TPpo2o0sWrUSko2Eb2Prq7DEXGK3jY7o597dmhJZbI1dEKGPnUs64kBvOI6aIa4S5t hf9Zt7tWbFSCcw3sbhanOgbLN1eU7mgouTkBi38E8oRxsca69siQ6Gh4Vt9ixUfMYWYW eetcUfxkhgwTubKzVbzSHhmwGC2jU8mxCO/NOWi60B2GgjGhgDttmULat8m6cFHl2YYI VpT9lQ58783V2ef8rZBFXNGa+qsyVNDAVf9GZBCGgKewkF5aPKeJnYJT1Iis3fqL58IB TOPMli6w7aa5+164YnO6fKZeta2ttT4TiZPVRDMyu1acJKNi345kjV5w/wdeS6EesCua ez4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mbobrowski-org.20150623.gappssmtp.com header.s=20150623 header.b=GXE8L9tS; 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 j6si9592850ejj.37.2019.09.10.05.37.47; Tue, 10 Sep 2019 05:38:11 -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; dkim=pass header.i=@mbobrowski-org.20150623.gappssmtp.com header.s=20150623 header.b=GXE8L9tS; 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 S2392627AbfIJKbz (ORCPT + 99 others); Tue, 10 Sep 2019 06:31:55 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:40089 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726482AbfIJKby (ORCPT ); Tue, 10 Sep 2019 06:31:54 -0400 Received: by mail-pf1-f196.google.com with SMTP id x127so11276278pfb.7 for ; Tue, 10 Sep 2019 03:31:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mbobrowski-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=xlKn3ut4vJcecpSFo5ylYLz+gUFXNHMgr09jHtOfi9Q=; b=GXE8L9tSnveu2iVuduadVJeglQ4bnnfqAlcLeq/VN65weRcTs4U9mZt6PS+/vNxczU kO/v5DolLrdcSJR7vqByi75hL8jH6lNjz9Tefic7i00tRdx6agM3RarSprAzlFiiHi3V rm/HTVmdlW7BbdTzfErW28LbNwkPGqrXvjgiYl1P2d9NWNYSPuQz+9g7IQDVZ+DKT6mM ZXeOhdYpm+yEQP+KJ15POogaWM/e/cDkdCkX0WDcvxRjGc8oQT/iyxyJBfSk0FYgpkuS JUwXonJnuGjKbs0ijFNEJXil/EsG2e+pjT/mJCqLgorMikbT2YbC8t5gxLIiPs+luK8z khig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=xlKn3ut4vJcecpSFo5ylYLz+gUFXNHMgr09jHtOfi9Q=; b=RlT4j+uRCn4dnUJZb3On1yysDgvUHDOXkIYSFcBRPP8QL9cx9DiyltTFlaovRdo3gg 8+7sIx046XN/J5U9UNv7Vv3uv58QJ2s4hzJP2P+AZPyw2iG31y4q4zjHJ26FWRZFQKTp kYZzdbwDYwdepS1ujwvlmPxJxUcLpIfK1XUOgoichm4M2h8s4ncMkWnaAOS8mofmpnJu GLy2r/NV02FajK5szDbRRLYkcAGK8YDC97YvyEzNfIdhZzp1FqscCeBM3+doDVtcVsHK by6UJcczZq0srwC8/j1nP7AZ2u4C0L6GL2FNtOvw8OGCqVW64eWCf50Vg/xlpD7hVFa8 7LYA== X-Gm-Message-State: APjAAAUJl7Xs0OBZe7W1eUmLhA8KUBZbeO/Ym12BGYp/SaKjkiVqCH8N lFiTSkaoHFncEnzf0vUC+nGW X-Received: by 2002:a63:f04:: with SMTP id e4mr26222183pgl.38.1568111513639; Tue, 10 Sep 2019 03:31:53 -0700 (PDT) Received: from bobrowski ([110.232.114.101]) by smtp.gmail.com with ESMTPSA id c11sm37380483pfj.114.2019.09.10.03.31.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2019 03:31:52 -0700 (PDT) Date: Tue, 10 Sep 2019 20:31:47 +1000 From: Matthew Bobrowski To: Ritesh Harjani Cc: tytso@mit.edu, jack@suse.cz, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, david@fromorbit.com, hch@infradead.org, darrick.wong@oracle.com Subject: Re: [PATCH v2 5/6] ext4: introduce direct IO write path using iomap infrastructure Message-ID: <20190910103147.GA10579@bobrowski> References: <7c2f0ee02b2659d5a45f3e30dbee66b443b5ea0a.1567978633.git.mbobrowski@mbobrowski.org> <20190909092617.07ECB42041@d06av24.portsmouth.uk.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190909092617.07ECB42041@d06av24.portsmouth.uk.ibm.com> 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 Mon, Sep 09, 2019 at 02:56:15PM +0530, Ritesh Harjani wrote: > On 9/9/19 4:49 AM, Matthew Bobrowski wrote: > > +/* > > + * For a write that extends the inode size, ext4_dio_write_iter() will > > + * wait for the write to complete. Consequently, operations performed > > + * within this function are still covered by the inode_lock(). > > + */ > Maybe add a comment that on success this returns 0. OK, can do. > > +static int ext4_dio_write_end_io(struct kiocb *iocb, ssize_t size, int error, > > + unsigned int flags) > > +{ > > + int ret = 0; > No need to initialize ret. > > > > + loff_t offset = iocb->ki_pos; > > + struct inode *inode = file_inode(iocb->ki_filp); > > + > > + if (error) { > > + ret = ext4_handle_failed_inode_extension(inode, offset + size); > > + return ret ? ret : error; > > + } > > + > > + if (flags & IOMAP_DIO_UNWRITTEN) { > > + ret = ext4_convert_unwritten_extents(NULL, inode, > > + offset, size); > > + if (ret) > > + return ret; > > + } > > + > > + if (offset + size > i_size_read(inode)) { > > + ret = ext4_handle_inode_extension(inode, offset, size, 0); > > + if (ret) > > + return ret; > > + } > > + return ret; > Directly return 0, since if it falls here it mans it is a success case. > You are anyway returning error from above error paths. OK, sure. ----