Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Commit

Permalink
kernel: fix 9p fs unlink-ftruncate
Browse files Browse the repository at this point in the history
Fixes #112

Signed-off-by: Julio Montes <[email protected]>
  • Loading branch information
Julio Montes committed Oct 3, 2017
1 parent 4fcb49e commit d60fef5
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
1 change: 1 addition & 0 deletions kernel/debian.series
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@
0206-no-early-modprobe.patch
0207-pci-guest-kernel-set-pci-net-class-bar-to-4.patch
0208-Show-restart-information-using-info-log.patch
0209-HACK-9P-always-use-cached-inode-to-fill-in-v9fs_vfs_.patch
0002-UBUNTU-SAUCE-no-up-disable-pie-when-gcc-has-it-enabl.patch
2 changes: 2 additions & 0 deletions kernel/linux-container.spec-template
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Patch0205: 0205-reboot.patch
Patch0206: 0206-no-early-modprobe.patch
Patch0207: 0207-pci-guest-kernel-set-pci-net-class-bar-to-4.patch
Patch0208: 0208-Show-restart-information-using-info-log.patch
Patch0209: 0209-HACK-9P-always-use-cached-inode-to-fill-in-v9fs_vfs_.patch

# Serie XYYY: Extra features modules

Expand Down Expand Up @@ -92,6 +93,7 @@ The Linux kernel.
%patch0206 -p1
%patch0207 -p1
%patch0208 -p1
%patch0209 -p1

# Serie XYYY: Extra features modules

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
From cb9d8ef839855dedb4cb9c167510b171a00b098d Mon Sep 17 00:00:00 2001
From: Julio Montes <[email protected]>
Date: Mon, 18 Sep 2017 11:46:59 -0500
Subject: [PATCH] HACK: 9P: always use cached inode to fill in v9fs_vfs_getattr

So that if in cache=none mode, we don't have to lookup server that
might not support open-unlink-fstat operation.

Signed-off-by: Peng Tao <[email protected]>
---
fs/9p/vfs_inode.c | 2 +-
fs/9p/vfs_inode_dotl.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index c00487e..0fc1cd4 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -1067,7 +1067,7 @@ v9fs_vfs_getattr(struct vfsmount *mnt, struct dentry *dentry,

p9_debug(P9_DEBUG_VFS, "dentry: %p\n", dentry);
v9ses = v9fs_dentry2v9ses(dentry);
- if (v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE) {
+ if (!d_really_is_negative(dentry) || v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE) {
generic_fillattr(d_inode(dentry), stat);
return 0;
}
diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c
index afaa4b6..0c6fb9c 100644
--- a/fs/9p/vfs_inode_dotl.c
+++ b/fs/9p/vfs_inode_dotl.c
@@ -477,7 +477,7 @@ v9fs_vfs_getattr_dotl(struct vfsmount *mnt, struct dentry *dentry,

p9_debug(P9_DEBUG_VFS, "dentry: %p\n", dentry);
v9ses = v9fs_dentry2v9ses(dentry);
- if (v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE) {
+ if (!d_really_is_negative(dentry) || v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE) {
generic_fillattr(d_inode(dentry), stat);
return 0;
}
--
2.7.5

0 comments on commit d60fef5

Please sign in to comment.