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=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 A0481C352A4 for ; Thu, 6 Feb 2020 15:32:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5BC4521927 for ; Thu, 6 Feb 2020 15:32:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="AnO9Ukc4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5BC4521927 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E58876B0003; Thu, 6 Feb 2020 10:32:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E07906B0006; Thu, 6 Feb 2020 10:32:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CF68B6B0007; Thu, 6 Feb 2020 10:32:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0147.hostedemail.com [216.40.44.147]) by kanga.kvack.org (Postfix) with ESMTP id B24D16B0003 for ; Thu, 6 Feb 2020 10:32:15 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 7190A1EF2 for ; Thu, 6 Feb 2020 15:32:15 +0000 (UTC) X-FDA: 76460093430.24.plant08_139ca95aacd03 X-HE-Tag: plant08_139ca95aacd03 X-Filterd-Recvd-Size: 4267 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Thu, 6 Feb 2020 15:32:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581003134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JkkJGmIOTY9azTSJOAyBmE/D2+0ai1ViZFBb2hElwXY=; b=AnO9Ukc4+ZurWSm9aUUDVQ9arxrq4O1xrvQhKIVuN9cdkIbj6YombtrB3rOmhwO2YVJJJj 5rJ+d5wTdW+oSYWMzmMfA8Yvts2n2Wz9c2+/O1zLrczUoMzOTMyhlcQS9e3tXJZLSHGGLq 8qksFDeJHE+95yL2+QkoNcyaj+9z/bw= Received: from mail-oi1-f197.google.com (mail-oi1-f197.google.com [209.85.167.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-301-kKllqhLlMh6x2_3957CfLQ-1; Thu, 06 Feb 2020 10:32:11 -0500 Received: by mail-oi1-f197.google.com with SMTP id w13so3000124oif.5 for ; Thu, 06 Feb 2020 07:32:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JkkJGmIOTY9azTSJOAyBmE/D2+0ai1ViZFBb2hElwXY=; b=oGAbVxw+V7KBEaf6ZmRRqm3DA6JUxBzgvIvtYjKWaEYKUUHhTbeT083W786ELQpuBI xo3jJq7Wr7fupIS6Y9nSQ31UTXx+bRvJoODFqxupLUXI+O3lyNzEtyG9vpc1UNwCxO1a JsNKxVMOiUHeTanYXQEsHA7YBr/AbVRs77nYziWqbhu+QaqKQM0NMePlMPA0IWYSH8Dr XKT9TBqseDMozzKruNJIJ37fZL4yxxXvHx+SAZkAFFmE5zq2JTr2t/Nt3NIuj3InNswN I5c8YTKMBtOMT+CLV4xHFrcrPf189gCxIKcogqPs4PP0DGR/nfQuiwch9aQu7iy1t65F 5jqg== X-Gm-Message-State: APjAAAWpIcS+m+qmgzyVpumVtSBH73eXq2ERfXXmDSqteHBG90rsR3q1 9V1Jk2YuNHMr/Ps5FfgBc0/JLH5BQuLU0gQfdtAknR0Xfi0vkEWmzEAYm+Kng0Q+rVtqfwQEDjb 947rWM328BDnhcZXMm/L48bB9D8s= X-Received: by 2002:aca:48d0:: with SMTP id v199mr7121507oia.10.1581003130604; Thu, 06 Feb 2020 07:32:10 -0800 (PST) X-Google-Smtp-Source: APXvYqz63b3BCvjFz9bZiKofXwlA69pEYM2GvuAIssv4co0has6j21zg9p8DSROFpl+t1g3/AiFAiFF1ObcmOqpV8Jw= X-Received: by 2002:aca:48d0:: with SMTP id v199mr7121485oia.10.1581003130363; Thu, 06 Feb 2020 07:32:10 -0800 (PST) MIME-Version: 1.0 References: <20200114161225.309792-1-hch@lst.de> <20200114161225.309792-6-hch@lst.de> In-Reply-To: <20200114161225.309792-6-hch@lst.de> From: Andreas Gruenbacher Date: Thu, 6 Feb 2020 16:31:58 +0100 Message-ID: Subject: Re: [Cluster-devel] [PATCH 05/12] gfs2: fix O_SYNC write handling To: Christoph Hellwig Cc: linux-xfs@vger.kernel.org, linux-fsdevel , Waiman Long , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Will Deacon , Andrew Morton , linux-ext4 , cluster-devel , Linux-MM , LKML X-MC-Unique: kKllqhLlMh6x2_3957CfLQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi Christoph, thanks for this patch, and sorry for taking so long to react. On Tue, Jan 14, 2020 at 5:54 PM Christoph Hellwig wrote: > Don't ignore the return value from generic_write_sync for the direct to > buffered I/O callback case when written is non-zero. Also don't bother > to call generic_write_sync for the pure direct I/O case, as iomap_dio_rw > already takes care of that. I like the idea, but the patch as is doesn't quite work: iomap_dio_rw already bumps iocb->ki_pos, so we end up with the wrong value by adding the (direct + buffered) write size again. We'd probably also be better served by replacing filemap_write_and_wait_range with generic_write_sync + IOCB_DSYNC in the buffered fallback case. I'll send an update that you'll hopefully like. Andreas