Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5530852ybl; Tue, 14 Jan 2020 10:27:49 -0800 (PST) X-Google-Smtp-Source: APXvYqzAgwowumWmQ+e36goZvgQjeGbzC97DLHKNP3PLTQjidfG1HIFJKosh1LC7V5+sx7d8gz3g X-Received: by 2002:aca:dc04:: with SMTP id t4mr17047250oig.51.1579026469400; Tue, 14 Jan 2020 10:27:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579026469; cv=none; d=google.com; s=arc-20160816; b=geh0Ysiu2DW0MbLR/aOfDyHRXODdTPvmxNmb4kAZmk3QCYtXggUB04dZ5NMhm/kcAl eLJxSJOhI0wJhjl0RM2IDkInh5769ZITlNbyfb/Uoo0FH3Xs8QF/PlCwqhJLGqv0q6N8 28v1uIm2yVO3eDi6vUyUWMxJPrDig9DscLk0mQjFP4QNusBtmuChlNadoIE8mHiPjRqD zfctLLlxfeBeClc6eeilIafQ8jLjGFjVEtu8aVV3SSs2KkwOFJP2p7S373YSrl7tr0SR ErK+sQGCwKV7jFNQ6+h/RhShmTk+cKmLEClm4GMiCYjO4eTIKpyzX+k/mgZIxvzZifyO CwPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=zmkp7vQ9ClPuKwJmCDKaq1sP9qHx2/tUi7SX3AWcZnE=; b=WxGdqu8iWJfggJH1PCca4ci7KaqXAZkdIfjh8nocOfRjQ4XMcADWjQVKOOkbI7srFE BIi9/VH0iJscsBrFLPlNmTGnhLoLKlSCnxnOtfyKbG+ma1m87BFuwZfC4xK0XKncDXMN 9jNQQwHKBWDbymEXcydPcDnYTRG3E0jZamD7ANjPOH1HtC4VVHXwUHBesKXcjo13brgU ygZQClyvcEUM8dPsagFBzclIY65N1FUmrV7ePwDuB0cpZ0rr6JnvOulIFq4/Mpi2Ollz aoo5Eo1lrGkCdDHQ6dCJDNnOmYQQt4FyvM6eqo/bXSFY+J9yYuV3E/9JO5spiD6Zpr9D E6yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Fiy1HBwL; 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 w7si7934908oie.196.2020.01.14.10.27.39; Tue, 14 Jan 2020 10:27:49 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Fiy1HBwL; 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 S1726491AbgANS1i (ORCPT + 99 others); Tue, 14 Jan 2020 13:27:38 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:55110 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726053AbgANS1i (ORCPT ); Tue, 14 Jan 2020 13:27:38 -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=zmkp7vQ9ClPuKwJmCDKaq1sP9qHx2/tUi7SX3AWcZnE=; b=Fiy1HBwLAhrH+05FpSFeaX9ZE N3kcGRj7mJezus/R4YiigXeuVlplr5RroPsScmnaJY7TtfmCZtUrJzOh7YrL7MKU2tuhEVW9QeuDG 9ntIUhq/MaOa9yiiV5CegCm4TcqQATJ3LGqDydDWA8K4mmOTEpKbntC+jwj6hjlThcCu9QtoXAbSj 4uPIfi4YcMkenkdNRpMBit6HhdY8NljeyhqQ0ygwep6Bp9nYQTLNYSCMjnYRb2OWttNybbjFVdSQ0 YcTiKybPR/fybeIDx0YSEACpg4fcEiX3OcrCZsN1GRp0orG92b+lAj1kCcMG53yI7H8Arr51yT/O7 TNEkSdpAA==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1irQue-0007rk-N3; Tue, 14 Jan 2020 18:27:36 +0000 Date: Tue, 14 Jan 2020 10:27:36 -0800 From: Christoph Hellwig To: Jan Kara Cc: Christoph Hellwig , Ritesh Harjani , linux-ext4@vger.kernel.org, tytso@mit.edu Subject: Re: [RFC 1/2] iomap: direct-io: Move inode_dio_begin before filemap_write_and_wait_range Message-ID: <20200114182736.GA27370@infradead.org> References: <27607a16327fe9664f32d09abe565af0d1ae56c9.1578907891.git.riteshh@linux.ibm.com> <20200114163702.GA7127@infradead.org> <20200114171934.GB22081@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200114171934.GB22081@quack2.suse.cz> 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 Tue, Jan 14, 2020 at 06:19:34PM +0100, Jan Kara wrote: > We want to detect in the writeback path whether there's direct IO (read) > currently running for the inode. Not for the writeback issued from > iomap_dio_rw() but for any arbitrary writeback that iomap_dio_rw() can be > racing with - so struct writeback_control won't help. Now if you want to > see the ugly details why this hack is needed, see my other email to Ritesh > in this thread with details of the race. How do we get other writeback after iomap_dio_rw wrote everything out? Either way I'm trying to kill i_dio_count as it has all kinds of problems, see the patch sent out earlier today.