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 B458DC7EE31 for ; Mon, 27 Feb 2023 14:50:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229826AbjB0Oux (ORCPT ); Mon, 27 Feb 2023 09:50:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229568AbjB0Ouu (ORCPT ); Mon, 27 Feb 2023 09:50:50 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46EFA21940 for ; Mon, 27 Feb 2023 06:50:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677509407; 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: in-reply-to:in-reply-to:references:references; bh=xVFwiCBVIfFFR8kctTViBDKk1JETgkz4F8ffh+Bi2ks=; b=gKndEYpVuQVmodbx+tm4KkMD1myfiQqrIQl4KBuhTtKAM8L9UHVOHOBn5f0BQSWFNAY1T+ JUcx9u/22TMmL2Zwdx1tUfVBirZPxdlvJua8hv3kBZuSK6wr9SaUJ5PldNUj0Id5Nhe70+ v2qHs9+SA7pOkxHfW1dAAkUm2dmUzgk= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-515-dV-XsYO5MwWkEY5Fc18XgQ-1; Mon, 27 Feb 2023 09:50:02 -0500 X-MC-Unique: dV-XsYO5MwWkEY5Fc18XgQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5B4A32A59570; Mon, 27 Feb 2023 14:50:01 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4476243FBB; Mon, 27 Feb 2023 14:50:00 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <20230202204428.3267832-5-willy@infradead.org> <20230202204428.3267832-1-willy@infradead.org> <2730679.1677505767@warthog.procyon.org.uk> To: Matthew Wilcox Cc: dhowells@redhat.com, linux-fsdevel@vger.kernel.org, linux-afs@lists.infradead.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-mm@kvack.org, Hugh Dickins , linux-kernel@vger.kernel.org, fstests@vger.kernel.org Subject: Re: [PATCH 4/5] afs: Zero bytes after 'oldsize' if we're expanding the file MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2736266.1677509399.1@warthog.procyon.org.uk> Date: Mon, 27 Feb 2023 14:49:59 +0000 Message-ID: <2736267.1677509399@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Matthew Wilcox wrote: > I'll send a patch series with all of this; it doesn't seem terribly > urgent. Do you think there's a similar problem for AFS that Brian > noted with the generic patch? Probably not. To avoid deadlocking itself, afs uses a mutex to prevent writepages racing with truncate (vnode->validate_lock). commit ec0fa0b659144d9c68204d23f627b6a65fa53e50 afs: Fix deadlock between writeback and truncate the afs_setattr_edit_file() call that changes i_size and partially clears the pagecache is applied to the local inode before the mutex is dropped. David