Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp21290462ybl; Mon, 6 Jan 2020 01:33:29 -0800 (PST) X-Google-Smtp-Source: APXvYqxorHlEZfxpsi/ShzlZUSuYXoYa4yu5lqtA4Pn3Cgw3dU2gZYYdmztls9RFuirl6eAqyVXd X-Received: by 2002:a05:6830:1d5b:: with SMTP id p27mr93292085oth.263.1578303209015; Mon, 06 Jan 2020 01:33:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578303209; cv=none; d=google.com; s=arc-20160816; b=raUJVBDSJCWFgesFuGfdTtsfY6X51PkPVZSKkDOen/6WjraYk9TOoxAwZApElO2rbg LIcs/ODf5P5sehtCJUyXJ+xEvJ1rf5k2yegVb5KXV43kfhP/c4GFcr+9dsX0WuA8sV9m 8bRgg8hKDKoyNkNrtgTeV35cD2BEYbONQnxq/sJxD2PCqId2PBRAf65a8/F/EPMN+fdD fnSs4EekOv0q97XmiI0ho0ovsbdXcF/AAveKi3on9PvVg9k/beeBkQZK5x66o22eAGEV iF1YH8dxsn+fofVZ9Dc/GoHA421mfhIieKD/WcVvy6RLJF6Rh6OpoV0do9pOOcPx3dBW G1og== 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=n7kMfdPaJbawAkwHLSN3EBnYTGyg8Crf5FNWvgSMEJA=; b=bco20VOovjf+Ad0H9zmzTvGR4xTvYeuqosbBkUOu/WYjj2KHt3mja2hd1DQOzWdvuJ IDKdMeaTOsKMWWhLcToHYJLKnYzh9gJjrq+nTDnczP0jZAQpUwWb377dHlUflUcLlqP8 C6GcDYWqP4GJPhEHen20k5mTjXbe8v4NqQ0w+pp8XM4BL1CIdRB8Y8PEtx1IF75OGHRy bG6/1zBPT2dmhb9J38EzVfA5+0YJQD/SXKdLFeGFj55KfgFFbBzu6E4qag86nAdyM7Sm MrNP+XZnpkXqU+CmAGiHju2uTSvYzMW3CjxdJZ4OBsvsHgH/eIPlde3KQMuaGieLaI7c hzqw== 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 b1si29158885oiy.9.2020.01.06.01.33.07; Mon, 06 Jan 2020 01:33:28 -0800 (PST) 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 S1726050AbgAFJdD (ORCPT + 99 others); Mon, 6 Jan 2020 04:33:03 -0500 Received: from mx2.suse.de ([195.135.220.15]:60660 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725446AbgAFJdD (ORCPT ); Mon, 6 Jan 2020 04:33:03 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D6F79AE19; Mon, 6 Jan 2020 09:33:01 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id EFCFE1E0B47; Mon, 6 Jan 2020 10:33:00 +0100 (CET) Date: Mon, 6 Jan 2020 10:33:00 +0100 From: Jan Kara To: "Theodore Y. Ts'o" Cc: Jan Kara , Ritesh Harjani , linux-ext4@vger.kernel.org, Dan Williams , "Berrocal, Eduardo" Subject: Re: [PATCH] ext4: Optimize ext4 DIO overwrites Message-ID: <20200106093300.GB9176@quack2.suse.cz> References: <20191218174433.19380-1-jack@suse.cz> <20191219135329.529E3A404D@d06av23.portsmouth.uk.ibm.com> <20191219192823.GA5389@quack2.suse.cz> <20191226171731.GE3158@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191226171731.GE3158@mit.edu> 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 Thu 26-12-19 12:17:31, Theodore Y. Ts'o wrote: > On Thu, Dec 19, 2019 at 08:28:23PM +0100, Jan Kara wrote: > > > However depending on which patch lands first one may need a > > > re-basing. Will conflict with this- > > > https://marc.info/?l=linux-ext4&m=157613016931238&w=2 > > > > Yes, but the conflict is minor and trivial to resolve. > > > > Is this the correct resolution? Looks good to me as well. Honza > > --- a/fs/ext4/file.c > +++ b/fs/ext4/file.c > @@ -447,6 +447,7 @@ static ssize_t ext4_dio_write_iter(struct kiocb *iocb, struct iov_iter *from) > struct inode *inode = file_inode(iocb->ki_filp); > loff_t offset = iocb->ki_pos; > size_t count = iov_iter_count(from); > + const struct iomap_ops *iomap_ops = &ext4_iomap_ops; > bool extend = false, unaligned_io = false; > bool ilock_shared = true; > > @@ -526,7 +527,9 @@ static ssize_t ext4_dio_write_iter(struct kiocb *iocb, struct iov_iter *from) > ext4_journal_stop(handle); > } > > - ret = iomap_dio_rw(iocb, from, &ext4_iomap_ops, &ext4_dio_write_ops, > + if (ilock_shared) > + iomap_ops = &ext4_iomap_overwrite_ops; > + ret = iomap_dio_rw(iocb, from, iomap_ops, &ext4_dio_write_ops, > is_sync_kiocb(iocb) || unaligned_io || extend); > > if (extend) > > - Ted > -- Jan Kara SUSE Labs, CR