Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2148523ybt; Fri, 3 Jul 2020 02:01:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwf5VvUOzW8VOdmcTaIxljFNsrDJe1vUBrnsLsMoQpqqmxDOQJWOdtEH+nAAHatRiL8M3DY X-Received: by 2002:a05:6402:203a:: with SMTP id ay26mr27990170edb.276.1593766904385; Fri, 03 Jul 2020 02:01:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593766904; cv=none; d=google.com; s=arc-20160816; b=EwuzS21F2rEipRq55KlxDH4pyTXixogU7oJFj2a1ntPrz/m9X+hzgYiSdkhQrqFTUp CmJRtaPKEgiZ2hXwf9h0yLfE93ZkGfwdGv3bfuN+U3TSHVIKn3m4A0PrcyZqLLT5LlK3 HtLbxmuowLcPNceOL/mn+lQQlrnAidQZ6246RDeBZwWhmIVc9sJbX70lUQzKLY5ZXUuQ oN62L55QAql6pc/zaknOcJDA30ShV7g8C5UQrfhcXklYTvFRlivlXLVt5FGhuY32ux/v HheVXlAXRzatQYpUFSptVhPgmujY1nzAT1WUkDIAhaVUDHkxIasWNQGKsdKamEmUhvJ6 QRjQ== 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=n76TciF1KLkDM6oGmpdwxmNT9lJsQGWP227kiQ6+Sv4=; b=GXs5swDdzd0KjaAs8UqrP6qj9lxoC7PX9MJe5Tiq5HhINfbWIqHUnug8OFLVPdTaYm /uGktCBNhrWiwisi+kvquF1tz1h9sW8oTM7HyPXhbnO04mUz9TYYfo6ntsIeD1uEMbou s1riVn5cV4UsmCYdnzdIOLmXqBT8ear7qxXcGgMfL8dp8/E9bhesXNZ2pMHFJP5gcz3Z uDt1THNae6WlHLnD/hoc0nzCcwqUMSmUtk93HUre7nYd/C7eOR8GSC3d/ATLCzGO9Gf4 puaO11DoV1NFwbSiw21C1Myj8RfNxcRcGywXT4wZRoBL34+q9iBq/v1IDExyKKOTBrUu QJAQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j17si7425804eds.349.2020.07.03.02.01.21; Fri, 03 Jul 2020 02:01:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726353AbgGCI6y (ORCPT + 99 others); Fri, 3 Jul 2020 04:58:54 -0400 Received: from nautica.notk.org ([91.121.71.147]:51096 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725891AbgGCI6y (ORCPT ); Fri, 3 Jul 2020 04:58:54 -0400 Received: by nautica.notk.org (Postfix, from userid 1001) id C3C1DC01E; Fri, 3 Jul 2020 10:58:52 +0200 (CEST) Date: Fri, 3 Jul 2020 10:58:37 +0200 From: Dominique Martinet To: Jianyong Wu Cc: ericvh@gmail.com, lucho@ionkov.net, v9fs-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org, Steve.Capper@arm.com, Kaly.Xin@arm.com, justin.he@arm.com, wei.chen@arm.com Subject: Re: [PATCH v3] 9p: retrieve fid from file when file instance exist. Message-ID: <20200703085837.GA3857@nautica> References: <20200703082018.8160-1-jianyong.wu@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200703082018.8160-1-jianyong.wu@arm.com> 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 Jianyong Wu wrote on Fri, Jul 03, 2020: > In the current setattr implementation in 9p, fid is always retrieved > from dentry no matter file instance exists or not. Thus, there may be > some info related to opened file instance dropped. So it's better > to retrieve fid from file instance when it has passed to setattr. > > for example: > fd=open("tmp", O_RDWR); > ftruncate(fd, 10); > > The file context related with the fd will be lost as fid is > retrieved from dentry, then the backend can't get the info of > file context. It is against the original intention of user and > may lead to bug. > > Signed-off-by: Jianyong Wu ACK. I've picked this up for tests, will push to linux-next when I finally manage to find time for these... -- Dominique