Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4280574ybg; Mon, 21 Oct 2019 06:39:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0VvYNGAPgGH6Qu0BGjMjr5TJWJqKYRnO769vTBEuHgDfA7PwAqYTJWNUGN8C539CCI3Qa X-Received: by 2002:a17:906:4d06:: with SMTP id r6mr22237384eju.90.1571665167572; Mon, 21 Oct 2019 06:39:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571665167; cv=none; d=google.com; s=arc-20160816; b=rybLJmkEJ6UzySCyRlwlokexGh3rQnsAzTomhfZcx+n+1QnR7n2bJx4vnBWQCfZvQA t8G9FJgzi2HzPhgZf0MF8MaubCoMlszS8ZNke5UxLoYsVzYND5jqarhyba1jL0cPfPAK ANEVw6ZgH8MziqC8D75/8uDl8tvY/qUMlBr8R2Imm2dec49neKEfLOo+HNHB+i1FpQ6+ Bd/2/SCVmVbPN5rjhZhKKkYEXqYA9GtsCruwJc45hye6FlzY64DdWUoxCixKLmvJ0f7k rAX1lUP+Vocqo9U/f9cxEf/yKqYonmdtCouKezzF6vN5iCtO3L27aaryPWQZ8jD+Tw8s U33g== 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=rCIMXgDDPlVgbJkviHP8IuzTV1DtOtUPqIVas4EGXcY=; b=TNETKMJ02uclMkQLjp9/wpeYvh9xB9zyU8PunRzFObZaz60SNP+A4C62zvw8dN1xpf lBZcegLyFTe/4ImSzjUNlEQGxboeGLo9klnUPxXMMId65sV3P4yBhhcdAdEaKsNjcuzb FJUHcaUEnCvStqT68LA2tJN2WT20Kp2vjbk/ZolxXhRPYvMXGtscL1I73lrvFXCJ61jH o/uq+g7O43or9bYC0XmVsSn4U6X2QMKalXuT6ZXBbGiAWTh8V5LDWUvGI5SEugtcmphe qr+7gJMWBkGEPsZJ2N7KbCF/z/xuzVW9ny54oj1rrd9Tq5pBYEoDYFobWATYy13lpyDy 4QOQ== 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 g21si8597266ejk.23.2019.10.21.06.39.03; Mon, 21 Oct 2019 06:39:27 -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 S1728812AbfJUNiW (ORCPT + 99 others); Mon, 21 Oct 2019 09:38:22 -0400 Received: from mx2.suse.de ([195.135.220.15]:54636 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729021AbfJUNiV (ORCPT ); Mon, 21 Oct 2019 09:38:21 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 39153AE2D; Mon, 21 Oct 2019 13:38:20 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id EC4F51E4AA0; Mon, 21 Oct 2019 15:38:19 +0200 (CEST) Date: Mon, 21 Oct 2019 15:38:19 +0200 From: Jan Kara To: mbobrowski@mbobrowski.org Cc: tytso@mit.edu, jack@suse.cz, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, hch@infradead.org, david@fromorbit.com, darrick.wong@oracle.com Subject: Re: [PATCH v5 06/12] xfs: Use iomap_dio_rw_wait() Message-ID: <20191021133819.GE25184@quack2.suse.cz> References: <78aac4cedf43825b3535a0d35dbba179ecbdffeb.1571647179.git.mbobrowski@mbobrowski.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <78aac4cedf43825b3535a0d35dbba179ecbdffeb.1571647179.git.mbobrowski@mbobrowski.org> 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 21-10-19 20:18:27, mbobrowski@mbobrowski.org wrote: > Use iomap_dio_rw() to wait for unaligned direct IO instead of opencoding > the wait. > > Signed-off-by: Jan Kara > --- > > This patch has already been posted through by Jan, but I've just > included it within this patch series to mark that it's a clear > dependency. This patch actually is not a dependency. But that doesn't really matter... Honza > > fs/xfs/xfs_file.c | 12 ++++-------- > 1 file changed, 4 insertions(+), 8 deletions(-) > > diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c > index 0739ba72a82e..c0620135a279 100644 > --- a/fs/xfs/xfs_file.c > +++ b/fs/xfs/xfs_file.c > @@ -547,16 +547,12 @@ xfs_file_dio_aio_write( > } > > trace_xfs_file_direct_write(ip, count, iocb->ki_pos); > - ret = iomap_dio_rw(iocb, from, &xfs_iomap_ops, &xfs_dio_write_ops, > - is_sync_kiocb(iocb)); > - > /* > - * If unaligned, this is the only IO in-flight. If it has not yet > - * completed, wait on it before we release the iolock to prevent > - * subsequent overlapping IO. > + * If unaligned, this is the only IO in-flight. Wait on it before we > + * release the iolock to prevent subsequent overlapping IO. > */ > - if (ret == -EIOCBQUEUED && unaligned_io) > - inode_dio_wait(inode); > + ret = iomap_dio_rw(iocb, from, &xfs_iomap_ops, &xfs_dio_write_ops, > + is_sync_kiocb(iocb) || unaligned_io); > out: > xfs_iunlock(ip, iolock); > > -- > 2.20.1 > > ---- -- Jan Kara SUSE Labs, CR