[PATCH] 9P: always use cached inode to fill in v9fs_vfs_getattr

Peng Tao bergwolf at gmail.com
Sat Jun 16 00:12:21 UTC 2018


On Fri, Jun 15, 2018 at 9:51 PM, Julio Montes <julio.montes at intel.com> wrote:
> BugLink: https://bugs.launchpad.net/ubuntu/+source/linux-kvm/+bug/1777137
>
> So that if in cache=none mode, we don't have to lookup server that
> might not support open-unlink-fstat operation.
>
> fixes https://github.com/01org/cc-oci-runtime/issues/47
> fixes https://github.com/01org/cc-oci-runtime/issues/1062
I don't think the patch is suitable for upstream in any case. It is a
simple workaround that assumes exclusive local access, which is true
for a container workload but does not stand in other cases.

NACK, sorry.

Cheers,
Tao

>
> Signed-off-by: Peng Tao <bergwolf at gmail.com>
> Acked-by: Julio Montes <julio.montes at intel.com>
> ---
>  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 bdabb2765d1b..30395e05e5f9 100644
> --- a/fs/9p/vfs_inode.c
> +++ b/fs/9p/vfs_inode.c
> @@ -1068,7 +1068,7 @@ v9fs_vfs_getattr(const struct path *path, struct kstat *stat,
>
>         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 7f6ae21a27b3..5d7e970a6e88 100644
> --- a/fs/9p/vfs_inode_dotl.c
> +++ b/fs/9p/vfs_inode_dotl.c
> @@ -481,7 +481,7 @@ v9fs_vfs_getattr_dotl(const struct path *path, struct kstat *stat,
>
>         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.13.6
>




More information about the kernel-team mailing list