qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 606953: 9pfs: fix readdir() for 9p2000.u


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 606953: 9pfs: fix readdir() for 9p2000.u
Date: Wed, 20 Sep 2017 14:03:00 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 6069537f4336a59054afda91a6545d3648c64619
      
https://github.com/qemu/qemu/commit/6069537f4336a59054afda91a6545d3648c64619
  Author: Jan Dakinevich <address@hidden>
  Date:   2017-09-20 (Wed, 20 Sep 2017)

  Changed paths:
    M hw/9pfs/9p.c

  Log Message:
  -----------
  9pfs: fix readdir() for 9p2000.u

If the client is using 9p2000.u, the following occurs:

$ cd ${virtfs_shared_dir}
$ mkdir -p a/b/c
$ ls a/b
ls: cannot access 'a/b/a': No such file or directory
ls: cannot access 'a/b/b': No such file or directory
a  b  c

instead of the expected:

$ ls a/b
c

This is a regression introduced by commit f57f5878578a;
local_name_to_path() now resolves ".." and "." in paths,
and v9fs_do_readdir_with_stat()->stat_to_v9stat() then
copies the basename of the resulting path to the response.
With the example above, this means that "." and ".." are
turned into "b" and "a" respectively...

stat_to_v9stat() currently assumes it is passed a full
canonicalized path and uses it to do two different things:
1) to pass it to v9fs_co_readlink() in case the file is a symbolic
   link
2) to set the name field of the V9fsStat structure to the basename
   part of the given path

It only has two users: v9fs_stat() and v9fs_do_readdir_with_stat().

v9fs_stat() really needs 1) and 2) to be performed since it starts
with the full canonicalized path stored in the fid. It is different
for v9fs_do_readdir_with_stat() though because the name we want to
put into the V9fsStat structure is the d_name field of the dirent
actually (ie, we want to keep the "." and ".." special names). So,
we only need 1) in this case.

This patch hence adds a basename argument to stat_to_v9stat(), to
be used to set the name field of the V9fsStat structure, and moves
the basename logic to v9fs_stat().

Signed-off-by: Jan Dakinevich <address@hidden>
(groug, renamed old name argument to path and updated changelog)
Signed-off-by: Greg Kurz <address@hidden>


  Commit: 4d8bc7334b06ef01a21cad3d1eb8dc183037a06b
      
https://github.com/qemu/qemu/commit/4d8bc7334b06ef01a21cad3d1eb8dc183037a06b
  Author: Jan Dakinevich <address@hidden>
  Date:   2017-09-20 (Wed, 20 Sep 2017)

  Changed paths:
    M hw/9pfs/9p.c

  Log Message:
  -----------
  9pfs: fix name_to_path assertion in v9fs_complete_rename()

The third parameter of v9fs_co_name_to_path() must not contain `/'
character.

The issue is most likely related to 9p2000.u protocol only.

Signed-off-by: Jan Dakinevich <address@hidden>
[groug, regression caused by commit f57f5878578a # 2.10]
Signed-off-by: Greg Kurz <address@hidden>


  Commit: 772a73692ecb52bace0cff6f95df62f59b8cabe0
      
https://github.com/qemu/qemu/commit/772a73692ecb52bace0cff6f95df62f59b8cabe0
  Author: Jan Dakinevich <address@hidden>
  Date:   2017-09-20 (Wed, 20 Sep 2017)

  Changed paths:
    M hw/9pfs/9p.c

  Log Message:
  -----------
  9pfs: check the size of transport buffer before marshaling

v9fs_do_readdir_with_stat() should check for a maximum buffer size
before an attempt to marshal gathered data. Otherwise, buffers assumed
as misconfigured and the transport would be broken.

The patch brings v9fs_do_readdir_with_stat() in conformity with
v9fs_do_readdir() behavior.

Signed-off-by: Jan Dakinevich <address@hidden>
[groug, regression caused my commit 8d37de41cab1 # 2.10]
Signed-off-by: Greg Kurz <address@hidden>


  Commit: b62b7ed0fc9c58e373b8946c9bd2e193be98dae6
      
https://github.com/qemu/qemu/commit/b62b7ed0fc9c58e373b8946c9bd2e193be98dae6
  Author: Peter Maydell <address@hidden>
  Date:   2017-09-20 (Wed, 20 Sep 2017)

  Changed paths:
    M hw/9pfs/9p.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging

These patches fix regressions in 2.10

# gpg: Signature made Wed 20 Sep 2017 07:51:07 BST
# gpg:                using DSA key 0x02FC3AEB0101DBC2
# gpg: Good signature from "Greg Kurz <address@hidden>"
# gpg:                 aka "Greg Kurz <address@hidden>"
# gpg:                 aka "Greg Kurz <address@hidden>"
# gpg:                 aka "Gregory Kurz (Groug) <address@hidden>"
# gpg:                 aka "[jpeg image of size 3330]"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 2BD4 3B44 535E C0A7 9894  DBA2 02FC 3AEB 0101 DBC2

* remotes/gkurz/tags/for-upstream:
  9pfs: check the size of transport buffer before marshaling
  9pfs: fix name_to_path assertion in v9fs_complete_rename()
  9pfs: fix readdir() for 9p2000.u

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


Compare: https://github.com/qemu/qemu/compare/d3f5433c7b4a...b62b7ed0fc9c

reply via email to

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