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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 895F9C83F12 for ; Mon, 28 Aug 2023 14:03:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229879AbjH1OCm (ORCPT ); Mon, 28 Aug 2023 10:02:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231420AbjH1OCX (ORCPT ); Mon, 28 Aug 2023 10:02:23 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D183BBA; Mon, 28 Aug 2023 07:02:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=EoGjlAqIr84+dzTRIVSh6MnXuXBwrPpcJyhAY3N5ock=; b=Cys3/JAywwflbjKeLLbxLR4Pml 1ZIuH88594x0nLpO6iJLXX9l6sI1h8ZkRVdCon46JySP7xwVSIy6uJlVUPCBG0I1jMUBp/0W9K9uT GCXP/OFE+JrmC3Pa+vZcLym98yS0JgfF9SpK8F8b18qNPjfvCtYSzNZ2k1S35WDywJTHF23uRdIPl X360jIARja8/zh1+SEIlBXc4nXvwCf4DxcPHjnlmChlDL/j2yB9CBDj1MRvDfFoTePW35BIjZXSeZ oEnIi346oyjWFuEc9Uk6usuZ2p/gFgmA/OPtZ8mAicao0VPMQqLBW8+t2E5sM608aGZst3O1yE7EK cxVGuQGg==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1qacoc-001ZYo-2Z; Mon, 28 Aug 2023 14:02:03 +0000 Date: Mon, 28 Aug 2023 15:02:02 +0100 From: Al Viro To: Christoph Hellwig Cc: Matthew Wilcox , Jens Axboe , Xiubo Li , Ilya Dryomov , Christian Brauner , Theodore Ts'o , Jaegeuk Kim , Chao Yu , Miklos Szeredi , Andreas Gruenbacher , "Darrick J. Wong" , Trond Myklebust , Anna Schumaker , Damien Le Moal , Andrew Morton , linux-block@vger.kernel.org, ceph-devel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, linux-xfs@vger.kernel.org, linux-nfs@vger.kernel.org, linux-mm@kvack.org, Hannes Reinecke Subject: Re: [PATCH 03/12] filemap: update ki_pos in generic_perform_write Message-ID: <20230828140202.GX3390869@ZenIV> References: <20230601145904.1385409-1-hch@lst.de> <20230601145904.1385409-4-hch@lst.de> <20230827194122.GA325446@ZenIV> <20230828123023.GA11084@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230828123023.GA11084@lst.de> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Mon, Aug 28, 2023 at 02:30:23PM +0200, Christoph Hellwig wrote: > On Sun, Aug 27, 2023 at 08:41:22PM +0100, Al Viro wrote: > > That part is somewhat fishy - there's a case where you return a positive value > > and advance ->ki_pos by more than that amount. I really wonder if all callers > > of ->write_iter() are OK with that. Consider e.g. this: > > This should not exist in the latest version merged by Jens. Can you > check if you still see issues in the version in the block tree or > linux-next. Still does - the problem has migrated into direct_write_fallback(), but that hadn't changed the situation. We are still left with ->ki_pos bumped by generic_perform_write() (evaluated as an argument of direct_write_fallback() now) and *not* retraced in case when direct_write_fallback() decides to discard the buffered write result. Both in -next and in mainline (since 6.5-rc1).