Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp450855ybt; Fri, 10 Jul 2020 04:12:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyg1TDadQcKynUcSqU3vUnj/xNVYjymqX2pEx02FLM0jO7Wb44Y4ioL7CRuCUx9tl/eBtry X-Received: by 2002:a05:6402:1ef:: with SMTP id i15mr58835775edy.378.1594379557677; Fri, 10 Jul 2020 04:12:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594379557; cv=none; d=google.com; s=arc-20160816; b=kUO6w0cdmTJkAr8buE7p4t70LyIvjrW4kRmjJpjcaXkhMZFMc2aGea4/or8UZNEJgy FGt+IiEh/vboyAB2iN9gLDX5ZZt1Ujc16IqqfZZUGTF4bS6CX3olQOwe85u/ulMmKyjc vMoKnEvTa8072COdujkjYB8in8+4wRWO+50f55OZ6/v3oDLcr3FZwpWBal507aUDY5Gv g8uYo8tCnKXE9aaryXpPZEDmmAV0GFEffT/CjdMRMPXDXthirjWv+DqsmUFUW9F4SLgh M2u1cjSwoq3nQGte++Cu5GG67H++rf84joN0xUTs5F5eXzpe3kTSXqfupmAfNsdozBIN rA/g== 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=IM6jxQfKOmb87OreuR2hv+b7q66aVE3zXYinfPQDxAM=; b=0bI76w1UNzD/pJ64srgo/3G7rUYPE4g0S2stDtrb4RLgykzQO6I84rouG/FcKtcfUh i3L7xVlcj4zg/wHwrbqbAGNWNqHa+dXyv1JVdPyaTiO/KgE3mrfitAOx7oPzE6GBdNXj 2bgvQorg3C5CX1t+R4zhcNcgmuY0aGcLTn3eYFLiIkJRO1nxs6Z3KqYWpG7R3xY9ocez 9Hp8RbagHxDaCo3YEJxs1i7i0AUPRTFmtt/Z0qeIbOjnO9cDCsHSi3U9Q8w6DTvP677o DmRhDY9o/rQ9f8UmPZAyXS+7K3l65LPM2fK2/RwP/OzbZ/5qXCfQxq+pPXboTXqlcz0e jaKA== 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 aq26si3851007ejc.401.2020.07.10.04.12.14; Fri, 10 Jul 2020 04:12:37 -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 S1728043AbgGJLJH (ORCPT + 99 others); Fri, 10 Jul 2020 07:09:07 -0400 Received: from nautica.notk.org ([91.121.71.147]:53271 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726725AbgGJLJH (ORCPT ); Fri, 10 Jul 2020 07:09:07 -0400 Received: by nautica.notk.org (Postfix, from userid 1001) id 2F266C009; Fri, 10 Jul 2020 13:09:05 +0200 (CEST) Date: Fri, 10 Jul 2020 13:08:50 +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 v4] 9p: retrieve fid from file when file instance exist. Message-ID: <20200710110850.GB17924@nautica> References: <20200710101548.10108-1-jianyong.wu@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200710101548.10108-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 10, 2020: > In the current setattr implementation in 9p, fid is always retrieved > from dentry no matter file instance exists or not. If so, there may be > some info related to opened file instance dropped. So it's better > to retrieve fid from file instance when it is 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 always > 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 > --- For next time, you can add arbitrary comments (e.g. describe briefly differences from previous versions) after the --- line. For others, this inits fid to NULL in both functions; thanks for picking it up I'll refresh the patch. -- Dominique