Received: by 2002:ac0:950e:0:0:0:0:0 with SMTP id f14csp1518500imc; Sun, 17 Mar 2019 17:05:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqV4RmaHRuYFdrjDlaSxFdnnQSx2L0MuPy6j744fxjtwW9JzUb6ZXtR+4ZUna1lOWbPmso X-Received: by 2002:a62:1e06:: with SMTP id e6mr16349042pfe.168.1552867550426; Sun, 17 Mar 2019 17:05:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552867550; cv=none; d=google.com; s=arc-20160816; b=f7apDKb4x0I1+jUwRsuWKe74QdbmIo3XQup49u8fev7tpoPW3Jw2ZQAtwYRmRSAIeq no9qalGR5sIzND3vP8FDcWyf6DK2+p5FUxJuWnN7tgDRgaT6PcMhv3TjCfBWLdp4GJ2i SVaN+j1gF5XFKlaxO1jc71ZLDfqJHNHqhuqI4pZFwyu3lrh8aZIIn4AewLmtgJCkWjqE R4ypHpdSNLBQhJuPi8ND7oL8mt7EEEy0SlW8/lGfF/s5WEoc6nweWzmWZ+Mn3C5wHVjK zLCXX7XDAS8/DPeb/zNH46NRii9RYslMr008ukz4VwRhIWDb9o5XqLEf59WOOnBCqGbO eC4Q== 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=YiBR2/Efh4MJHZuhWuPOMeog+lT7+Fe9Bhv9yPY0crQ=; b=e9Kh0JoQaDkhPqXC1GSvTYW0gTk38G4ArSOTuYHMQGNjiI+pfGHBtrHBsGz/2M+4+u Bx9uzbQbrXDHF9r9C9a16ZFNMcMuiJWChdttm7x2fpacLIyE/DtlvCJT0BjnQfcpNwLm XVGs6oRPlt0EpEdae3cWQzMGStzDaa/RTvmLMa/3JQhwbybBnFa8r1iLknP1n4KVOmqx C71oBhZj1/RKp3+dYF8D7yLE5iAxbsycZGcE8WzOSnaVUYBhVhy9VHQZ44e/kqz5vupY vq6b3EjYRqonfB+peTd+xAOYHjCnXUdHEpOvssprjtncnwf40nZouXia19S8YuPIsPiv xTcA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 v35si5543157plg.382.2019.03.17.17.05.35; Sun, 17 Mar 2019 17:05:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727794AbfCRAEU (ORCPT + 99 others); Sun, 17 Mar 2019 20:04:20 -0400 Received: from nautica.notk.org ([91.121.71.147]:56412 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727535AbfCRAEU (ORCPT ); Sun, 17 Mar 2019 20:04:20 -0400 Received: by nautica.notk.org (Postfix, from userid 1001) id 777D4C009; Mon, 18 Mar 2019 01:04:17 +0100 (CET) Date: Mon, 18 Mar 2019 01:04:02 +0100 From: Dominique Martinet To: Linus Torvalds Cc: v9fs-developer@lists.sourceforge.net, Linux List Kernel Mailing , Netdev Subject: Re: [GIT PULL] 9p updates for 5.1 Message-ID: <20190318000402.GA24768@nautica> References: <20190317142524.GA5136@nautica> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Linus Torvalds wrote on Sun, Mar 17, 2019: > Hmm. I wonder what makes it valid to have concurrent updates to > i_size? Yes, yes, you added that spinlock to make the update itself > atomic on 32-bit, but it sounds a bit odd in the first place to have > two things possibly changing the size of a file at the same time... If the inode attributes are currently invalid (for example after v9fs_invalidate_inode_attr()) then two concurrent user getattr requests for the same inode will send two network requests which can both update the i_size. With cache=fscache or loose a write could also be concurrent with such an update. I plan on improving the first case with some "being revalidated" logic now this pattern got reported but I don't think the second one can be avoided, so that fix is still necessary in the long run afaict. Thanks, -- Dominique