Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1396209ybh; Sun, 19 Jul 2020 18:47:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBnCPBaJmAjukhYBdsfxl0pVuX4eD0ZNwkMbKcV2JEsX66bZ2TMI27iQhA2YCpPGSy0zot X-Received: by 2002:a17:906:2b0e:: with SMTP id a14mr18254867ejg.459.1595209658104; Sun, 19 Jul 2020 18:47:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595209658; cv=none; d=google.com; s=arc-20160816; b=nSWPGWa6Xsnpem8Mohk0y9IZcCe1u7iaCXW5TUwCEA9lJMNROfWHkYnd2sXD/zutGK Hms/1EVuqf+7Jp8UqnnzkY+yFYvebqohfMOVOxnJjq5uIVqNuvbybaUX4nwtWxp8Gt3F 1m9k9bf7tKl8B+YKuS5mR6xFAynep/3FOfiMQtr/ulpPXjhzLK8UyHr5nCxdKZ+yezKD zKDU5egpmjyG/yA6Jkw44PyRJ7x52ghrYW0wREw7zcFdcuBcFdvJWEGtuUtuVLR72+2B oUdiakdWdzaBEXo5nvPgRsZ4dg16rB18wuSz1krFFfeYEqGMT/vK/cdthvn6m/hQnJ+q A64w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=gUyl8P1CpYgcyTqgbAPH6wDS6pkg8YvdPI5u9vWM7xA=; b=GDK9EcZGqFEX4E6Mycw88EWCKyeuuQAf/D8xiX7/RGkK0WGqsbV2TX9+0T+iZ4imAK KNPAg8A0RgwlmA727T7uFszs0/EY8m1+AVppRAowACnAo94GoJsNa8/F/g1zbrzBxSGo 2xkFUwJWneEr6cvLQJYLnq3kySEGVgpiQ7gLyYrq40brGCE6iVkxQQyoOkpe9sJIGcI8 BWq6qAyDhtdJq83aRYzzjR0PcBWt39b8lSkz5t9ih6I9SK/4Wxa+fICZAwsViBScd/v8 Xbn90M1AQ26C1aEHqsyM3TTOGhquHj6CPQC4DIWWN3JmEgvW5Wh8g4U7ceoqgipHcvDS i7MQ== 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 h17si9415474ejd.655.2020.07.19.18.47.16; Sun, 19 Jul 2020 18:47:38 -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 S1726888AbgGTBqe (ORCPT + 99 others); Sun, 19 Jul 2020 21:46:34 -0400 Received: from foss.arm.com ([217.140.110.172]:40784 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726312AbgGTBqe (ORCPT ); Sun, 19 Jul 2020 21:46:34 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F2D10106F; Sun, 19 Jul 2020 18:46:33 -0700 (PDT) Received: from entos-d05.shanghai.arm.com (entos-d05.shanghai.arm.com [10.169.212.212]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 9035F3F66E; Sun, 19 Jul 2020 18:46:30 -0700 (PDT) From: Jianyong Wu To: ericvh@gmail.com, hch@lst.de, dhowells@redhat.com, lucho@ionkov.net, asmadeus@codewreck.org Cc: v9fs-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org, Kaly.Xin@arm.com, justin.he@arm.com, jianyong.wu@arm.com, wei.chen@arm.com Subject: [RFC PATCH 0/2] vfs:9p: fix open-unlink-fstat bug Date: Mon, 20 Jul 2020 09:46:20 +0800 Message-Id: <20200720014622.37364-1-jianyong.wu@arm.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org how to reproduce: in 9p guest: struct stat *statbuf; int fd; fd = open("tmp", O_RDWR); unlink("tmp"); fstat(fd, statbuf); fstat will fail as "tmp" in 9p server side has been removed. 9p server can't retrieve the file context as the guest has not passed it down. so we should pass the file info down in 9p guest in getattr op. it need add a new file member in "struct kstat" as "struct istat" does. Jianyong Wu (2): vfs: pass file down when getattr to avoid losing info. 9p: retrieve fid from file if it exists when getattr. fs/9p/vfs_inode.c | 9 +++++++-- fs/9p/vfs_inode_dotl.c | 9 +++++++-- fs/stat.c | 1 + include/linux/stat.h | 6 ++++++ 4 files changed, 21 insertions(+), 4 deletions(-) -- 2.17.1