From patchwork Mon Mar 18 11:22:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Sindholt X-Patchwork-Id: 13595291 Received: from wirbelwind.zhasha.com (wirbelwind.zhasha.com [78.109.210.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36906374EB for ; Mon, 18 Mar 2024 11:26:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.109.210.80 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710761179; cv=none; b=iNmpEZdg0/IJ4gPZscwWbw485WDCrAWogGxMymOdwgbIYTsyF994ezJuSRJE01S9Ouvtanltgdjp57WcePJ+Ss1hBHvR4R7y1TT4se3xDr+j4/AzVN/WftU3sg7Rkpbd1gsYIkomfTl20fseQkGlikJsDef05gkwgaRT5Thc1sU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710761179; c=relaxed/simple; bh=WiD9Zf6gkKdRv7a04KqDRYGwN6FHh7IolBIC40I2SOg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QhbbTo6jlZlKvhRmZ2OR9JUewyK18gtdFn6WA++LM2/L99LmXfWPxH1xzaylJV+QncjdDiQ1Oa2weKpaCAy6+8ZV3QsntaYqZUKfV2ZNoD0h0lt1RpdKVY3RmnUJdrfZeVMfUNfhoWdzBirMPW2grj/yuZNe2sWatkJEklPeLJU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=zhasha.com; spf=pass smtp.mailfrom=zhasha.com; dkim=pass (1024-bit key) header.d=zhasha.com header.i=@zhasha.com header.b=RdbPde5J; arc=none smtp.client-ip=78.109.210.80 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=zhasha.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zhasha.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=zhasha.com header.i=@zhasha.com header.b="RdbPde5J" Received: from localhost.localdomain (unknown [77.72.50.149]) by wirbelwind.zhasha.com (Postfix) with ESMTPSA id 1846D32539B; Mon, 18 Mar 2024 12:26:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zhasha.com; s=wirbelwind; t=1710761168; bh=swXzucw9zpRyz/6vatGs1dOV16XHKiwYBQ13TCtb/zs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=RdbPde5Jd2xKc9yBfoMrwkjFNYqGmdRwTNX9/bPEW5VNA/eYBGrJRE3vS1EflnkdJ VrjXor54xaxJLA2uXpPjTYJEzdm95THm88BMRwBkhRjuFFOGT4YPM0CNHc3d3R2qYo zQv+Qf1swJvTo/1q/gvDr3PUjVNlvjwkePCEK9m8= From: Joakim Sindholt To: v9fs@lists.linux.dev Cc: Joakim Sindholt Subject: [PATCH v2 1/4] fs/9p: only translate RWX permissions for plain 9P2000 Date: Mon, 18 Mar 2024 12:22:31 +0100 Message-ID: <20240318112542.18863-2-opensource@zhasha.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240318112542.18863-1-opensource@zhasha.com> References: <20240318112542.18863-1-opensource@zhasha.com> Precedence: bulk X-Mailing-List: v9fs@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Joakim Sindholt --- fs/9p/vfs_inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 32572982f72e..1180d1453a5a 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c @@ -83,7 +83,7 @@ static int p9mode2perm(struct v9fs_session_info *v9ses, int res; int mode = stat->mode; - res = mode & S_IALLUGO; + res = mode & S_IRWXUGO; if (v9fs_proto_dotu(v9ses)) { if ((mode & P9_DMSETUID) == P9_DMSETUID) res |= S_ISUID; From patchwork Mon Mar 18 11:22:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Sindholt X-Patchwork-Id: 13595293 Received: from wirbelwind.zhasha.com (wirbelwind.zhasha.com [78.109.210.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 35018374E9 for ; Mon, 18 Mar 2024 11:26:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.109.210.80 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710761181; cv=none; b=U7Jn4KV2UbjD+UM+DCKs4xOjmRRVCQqKK2M4D4sDF6zzILGt1hZUIxuNgWciPvjDCdkh//2Zv4O2lOydn18L5sudcJRr5225Rk/LBHmtQUSqM2lC2s2xonBuKlb73l0F0DzeDm6+eP7nVsxKs/N6KXLdxENVByBpz+xedZ8hGWw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710761181; c=relaxed/simple; bh=fBoA/ZVuj4XXc9PmaJNvE74TYP0ZY+ZINlyMG3jYGQw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kx5K/crXgsIdMFY3N23VcQ8TIkLGzSJrjxSjUoIAP7mfn7X0nCpJcBKlyOb3YL7Hbp+D9fsUPE8B/C0KomFKbgIRgisQ2nP/LYmov9mleDsrWtyTRMNhpq2O57ZgtFed42BiasBLF4NJ3OUhz3UM+1+fetETS6tMIn2v09HMfUA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=zhasha.com; spf=pass smtp.mailfrom=zhasha.com; dkim=pass (1024-bit key) header.d=zhasha.com header.i=@zhasha.com header.b=JQpg67tb; arc=none smtp.client-ip=78.109.210.80 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=zhasha.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zhasha.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=zhasha.com header.i=@zhasha.com header.b="JQpg67tb" Received: from localhost.localdomain (unknown [77.72.50.149]) by wirbelwind.zhasha.com (Postfix) with ESMTPSA id 2775E32539C; Mon, 18 Mar 2024 12:26:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zhasha.com; s=wirbelwind; t=1710761168; bh=GAOe8Cd9W5lYFDNnzzGvir5mykzKmwgzcDhPWyEG/Ms=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=JQpg67tbYDKBIqqxP6SY3Y8m6eF2vTyWAZ5KOkepPelatB/qvlr9gly5WQ2elGYvn CJjBcIOQybpBsqyGSn6QMJwmZR7vIMLLTbvr6J4/KleSbpQzSGWBmp9l3TXxYPuLMN eaInDQeJymwMSemgLrGoxgB1przQz+kuAa/J+a5c= From: Joakim Sindholt To: v9fs@lists.linux.dev Cc: Joakim Sindholt Subject: [PATCH v2 2/4] fs/9p: drop inodes immediately on non-.L too Date: Mon, 18 Mar 2024 12:22:32 +0100 Message-ID: <20240318112542.18863-3-opensource@zhasha.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240318112542.18863-1-opensource@zhasha.com> References: <20240318112542.18863-1-opensource@zhasha.com> Precedence: bulk X-Mailing-List: v9fs@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Joakim Sindholt --- fs/9p/vfs_super.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c index 941f7d0e0bfa..23cc67f29af2 100644 --- a/fs/9p/vfs_super.c +++ b/fs/9p/vfs_super.c @@ -310,6 +310,7 @@ static const struct super_operations v9fs_super_ops = { .alloc_inode = v9fs_alloc_inode, .free_inode = v9fs_free_inode, .statfs = simple_statfs, + .drop_inode = v9fs_drop_inode, .evict_inode = v9fs_evict_inode, .show_options = v9fs_show_options, .umount_begin = v9fs_umount_begin, From patchwork Mon Mar 18 11:22:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Sindholt X-Patchwork-Id: 13595292 Received: from wirbelwind.zhasha.com (wirbelwind.zhasha.com [78.109.210.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 329ED374D3 for ; Mon, 18 Mar 2024 11:26:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.109.210.80 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710761181; cv=none; b=E2qXr5hlFtEdy2Kf0gsKNBuXHf91NFBsGhlxG5JLkLLKTs6eBH2Hs+2iuwVDS9cbRgbvFAOmnGS+9FFMoJ3BS38Z783lyCn1d+k8GODjq6u+M0kNOquLJQX8MT5gp+3dMR08+AYTQcUJLgpQxi9rLoleyWeT21HpB9FvgpTvTxU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710761181; c=relaxed/simple; bh=ngfGFDKdvJ4xtRZcFGSFN5zAf4TsRcN9PigOhDe32Fg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uvhIRfUOWwR6vCUme0jL//ChVxBeO9K6ZnPgh83ciAWCgx2elSqaudPsiv/p1Gt5KTDk7uBB5DLcQ2eB2ScBzwLsUhflR22dvKwuBoGphJ6VNwZLsQ0JSIuAcPTUxX55301sFNEHCET9mgFJxKE6HKUvOYXexLByl2J/qUxbHfg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=zhasha.com; spf=pass smtp.mailfrom=zhasha.com; dkim=pass (1024-bit key) header.d=zhasha.com header.i=@zhasha.com header.b=OxZjLSUT; arc=none smtp.client-ip=78.109.210.80 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=zhasha.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zhasha.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=zhasha.com header.i=@zhasha.com header.b="OxZjLSUT" Received: from localhost.localdomain (unknown [77.72.50.149]) by wirbelwind.zhasha.com (Postfix) with ESMTPSA id 370EA32539D; Mon, 18 Mar 2024 12:26:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zhasha.com; s=wirbelwind; t=1710761168; bh=FwR84NY4Fq3RQ28ZavYtrBchBkoth35FkYRwVZ/Xe0Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=OxZjLSUTXzyU+eFhb9yEXjmIDj/TfkOXUpwmM8mXAnS9PtvwX+xbO2Q8EbIUJ+hO3 ekycDGZYknLcPJ+lXb7Y9n+BAOuD1sc0EgulgHfREHj2D69q7Wa31CodnzW3vSb8kA HEEgBhC3j+GE18DXqgE+UpF9HKqGn6KU/JPiacbk= From: Joakim Sindholt To: v9fs@lists.linux.dev Cc: Joakim Sindholt Subject: [PATCH v2 3/4] fs/9p: translate O_TRUNC into OTRUNC Date: Mon, 18 Mar 2024 12:22:33 +0100 Message-ID: <20240318112542.18863-4-opensource@zhasha.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240318112542.18863-1-opensource@zhasha.com> References: <20240318112542.18863-1-opensource@zhasha.com> Precedence: bulk X-Mailing-List: v9fs@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Joakim Sindholt --- fs/9p/vfs_inode.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 1180d1453a5a..8f2e0fcfb303 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c @@ -178,6 +178,9 @@ int v9fs_uflags2omode(int uflags, int extended) break; } + if (uflags & O_TRUNC) + ret |= P9_OTRUNC; + if (extended) { if (uflags & O_EXCL) ret |= P9_OEXCL; From patchwork Mon Mar 18 11:22:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Sindholt X-Patchwork-Id: 13595294 Received: from wirbelwind.zhasha.com (wirbelwind.zhasha.com [78.109.210.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 37EF9374D2 for ; Mon, 18 Mar 2024 11:26:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.109.210.80 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710761181; cv=none; b=pR6x/ZavD84kPz582Jn9CbpByAo9mWI7l09kKco3gK0Mo+Fhl3Wwp4v+0s9oKZzKjb0qv44aPYWtyTHTp7g4/ZlP2UQiU/VMKepmxC0tAjywmfNU+I/znvL1mX9g/yCYKJGUUFmtizdlpf5jC/eFKjbAa/fTr1YWg9K7S2Gcax0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710761181; c=relaxed/simple; bh=w/o0rBrwx4L5j9FAAWuCiTxWCcWKc945olpJN0XZcSg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fQdsi+5EcaezmDWtqt/8EhbUMa33Q47mEDY16n9vAZt3LFuxKADMYs+qZ+jK1u430UN9rqPoOLtznov28QYzaycVqWzavjIFXdChMGrL5l/03EgBGK/saYcIbpOMtiFJSWgmA3mO1vRim5V5HGUY6YacK+oqfNV8h4dd0z1JdPo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=zhasha.com; spf=pass smtp.mailfrom=zhasha.com; dkim=pass (1024-bit key) header.d=zhasha.com header.i=@zhasha.com header.b=aYTXshMi; arc=none smtp.client-ip=78.109.210.80 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=zhasha.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zhasha.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=zhasha.com header.i=@zhasha.com header.b="aYTXshMi" Received: from localhost.localdomain (unknown [77.72.50.149]) by wirbelwind.zhasha.com (Postfix) with ESMTPSA id 46C3932539E; Mon, 18 Mar 2024 12:26:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zhasha.com; s=wirbelwind; t=1710761168; bh=bF7lYMPfodz2FpwZ3JfV1WLCrwViWNpA5vGulXInli4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=aYTXshMijQ46yXAnBPO+AAlTDpYEC05gwGM1a4DBh167hdsvr7To3nVHgc1o4JMOB AclFCYIVVqWrdaLi+pocjcUxT9e4DKm1uPa7HBJ8lXRP9d/8/BTLritVCIIFZ0RgdB 4kzH58H6gpRG8N770qtdOjduspiXhq8vrofurF9A= From: Joakim Sindholt To: v9fs@lists.linux.dev Cc: Joakim Sindholt Subject: [PATCH v2 4/4] fs/9p: fix the cache always being enabled on files with qid flags Date: Mon, 18 Mar 2024 12:22:34 +0100 Message-ID: <20240318112542.18863-5-opensource@zhasha.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240318112542.18863-1-opensource@zhasha.com> References: <20240318112542.18863-1-opensource@zhasha.com> Precedence: bulk X-Mailing-List: v9fs@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Joakim Sindholt --- fs/9p/fid.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/9p/fid.h b/fs/9p/fid.h index 29281b7c3887..0d6138bee2a3 100644 --- a/fs/9p/fid.h +++ b/fs/9p/fid.h @@ -49,9 +49,6 @@ static inline struct p9_fid *v9fs_fid_clone(struct dentry *dentry) static inline void v9fs_fid_add_modes(struct p9_fid *fid, unsigned int s_flags, unsigned int s_cache, unsigned int f_flags) { - if (fid->qid.type != P9_QTFILE) - return; - if ((!s_cache) || ((fid->qid.version == 0) && !(s_flags & V9FS_IGNORE_QV)) || (s_flags & V9FS_DIRECT_IO) || (f_flags & O_DIRECT)) {