qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 16e15a: virtiofsd: passthrough_ll: cleanup ge


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 16e15a: virtiofsd: passthrough_ll: cleanup getxattr/listxattr
Date: Tue, 03 Mar 2020 09:30:15 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 16e15a73089102c3d8846792d514e769300fcc3c
      
https://github.com/qemu/qemu/commit/16e15a73089102c3d8846792d514e769300fcc3c
  Author: Misono Tomohiro <address@hidden>
  Date:   2020-03-03 (Tue, 03 Mar 2020)

  Changed paths:
    M tools/virtiofsd/passthrough_ll.c

  Log Message:
  -----------
  virtiofsd: passthrough_ll: cleanup getxattr/listxattr

This is a cleanup patch to simplify the following xattr fix and
there is no functional changes.

- Move memory allocation to head of the function
- Unify fgetxattr/flistxattr call for both size == 0 and
  size != 0 case
- Remove redundant lo_inode_put call in error path
  (Note: second call is ignored now since @inode is already NULL)

Signed-off-by: Misono Tomohiro <address@hidden>
Message-Id: <address@hidden>
Acked-by: Vivek Goyal <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>


  Commit: bdfd66788349acc43cd3f1298718ad491663cfcc
      
https://github.com/qemu/qemu/commit/bdfd66788349acc43cd3f1298718ad491663cfcc
  Author: Misono Tomohiro <address@hidden>
  Date:   2020-03-03 (Tue, 03 Mar 2020)

  Changed paths:
    M tools/virtiofsd/fuse_virtio.c
    M tools/virtiofsd/passthrough_ll.c
    M tools/virtiofsd/seccomp.c

  Log Message:
  -----------
  virtiofsd: Fix xattr operations

Current virtiofsd has problems about xattr operations and
they does not work properly for directory/symlink/special file.

The fundamental cause is that virtiofsd uses openat() + f...xattr()
systemcalls for xattr operation but we should not open symlink/special
file in the daemon. Therefore the function is restricted.

Fix this problem by:
 1. during setup of each thread, call unshare(CLONE_FS)
 2. in xattr operations (i.e. lo_getxattr), if inode is not a regular
    file or directory, use fchdir(proc_loot_fd) + ...xattr() +
    fchdir(root.fd) instead of openat() + f...xattr()

    (Note: for a regular file/directory openat() + f...xattr()
     is still used for performance reason)

With this patch, xfstests generic/062 passes on virtiofs.

This fix is suggested by Miklos Szeredi and Stefan Hajnoczi.
The original discussion can be found here:
  https://www.redhat.com/archives/virtio-fs/2019-October/msg00046.html

Signed-off-by: Misono Tomohiro <address@hidden>
Message-Id: <address@hidden>
Acked-by: Vivek Goyal <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>


  Commit: abfa865014ab17941eb1fcb7cc2fa293a25843c4
      
https://github.com/qemu/qemu/commit/abfa865014ab17941eb1fcb7cc2fa293a25843c4
  Author: Peter Maydell <address@hidden>
  Date:   2020-03-03 (Tue, 03 Mar 2020)

  Changed paths:
    M tools/virtiofsd/fuse_virtio.c
    M tools/virtiofsd/passthrough_ll.c
    M tools/virtiofsd/seccomp.c

  Log Message:
  -----------
  Merge remote-tracking branch 
'remotes/dgilbert-gitlab/tags/pull-virtiofs-20200303' into staging

Virtiofsd pull 2020-03-03

xattr fixes from Misono.

# gpg: Signature made Tue 03 Mar 2020 15:15:04 GMT
# gpg:                using RSA key 45F5C71B4A0CB7FB977A9FA90516331EBC5BFDE7
# gpg: Good signature from "Dr. David Alan Gilbert (RH2) <address@hidden>" 
[full]
# Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A  9FA9 0516 331E BC5B FDE7

* remotes/dgilbert-gitlab/tags/pull-virtiofs-20200303:
  virtiofsd: Fix xattr operations
  virtiofsd: passthrough_ll: cleanup getxattr/listxattr

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/104933c4a973...abfa865014ab



reply via email to

[Prev in Thread] Current Thread [Next in Thread]