qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] acef3f: 9pfs/proxy: Check return value of pro


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] acef3f: 9pfs/proxy: Check return value of proxy_marshal()
Date: Mon, 25 Jan 2021 07:56:10 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: acef3f8b47060f05e13de5b615268c39b274aab0
      
https://github.com/qemu/qemu/commit/acef3f8b47060f05e13de5b615268c39b274aab0
  Author: Greg Kurz <groug@kaod.org>
  Date:   2021-01-21 (Thu, 21 Jan 2021)

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

  Log Message:
  -----------
  9pfs/proxy: Check return value of proxy_marshal()

This should always successfully write exactly two 32-bit integers.
Make it clear with an assert(), like v9fs_receive_status() and
v9fs_receive_response() already do when unmarshalling the same
header.

Fixes: Coverity CID 1438968
Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Message-Id: <161035859647.1221144.4691749806675653934.stgit@bahia.lan>
Signed-off-by: Greg Kurz <groug@kaod.org>


  Commit: 2e53160fc62d4d59c76bf93c7a90bd739b8b8157
      
https://github.com/qemu/qemu/commit/2e53160fc62d4d59c76bf93c7a90bd739b8b8157
  Author: Greg Kurz <groug@kaod.org>
  Date:   2021-01-21 (Thu, 21 Jan 2021)

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

  Log Message:
  -----------
  9pfs: Convert V9fsFidState::clunked to bool

This can only be 0 or 1.

Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Message-Id: <20210118142300.801516-2-groug@kaod.org>
Signed-off-by: Greg Kurz <groug@kaod.org>


  Commit: feabd6cf78ca3b57da2ce48e95b704e72147bf2c
      
https://github.com/qemu/qemu/commit/feabd6cf78ca3b57da2ce48e95b704e72147bf2c
  Author: Greg Kurz <groug@kaod.org>
  Date:   2021-01-21 (Thu, 21 Jan 2021)

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

  Log Message:
  -----------
  9pfs: Convert V9fsFidState::fid_list to QSIMPLEQ

The fid_list is currently open-coded. This doesn't seem to serve any
purpose that cannot be met with QEMU's generic lists. Let's go for a
QSIMPLEQ : this will allow to add new fids at the end of the list and
to improve the logic in v9fs_mark_fids_unreclaim().

Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Message-Id: <20210118142300.801516-3-groug@kaod.org>
Signed-off-by: Greg Kurz <groug@kaod.org>


  Commit: 20b7f45b22c3c00dc6f8bc73a66dffb6d436aa85
      
https://github.com/qemu/qemu/commit/20b7f45b22c3c00dc6f8bc73a66dffb6d436aa85
  Author: Greg Kurz <groug@kaod.org>
  Date:   2021-01-22 (Fri, 22 Jan 2021)

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

  Log Message:
  -----------
  9pfs: Improve unreclaim loop

If a fid was actually re-opened by v9fs_reopen_fid(), we re-traverse the
fid list from the head in case some other request created a fid that
needs to be marked unreclaimable as well (i.e. the client opened a new
handle on the path that is being unlinked). This is suboptimal since
most if not all fids that require it have likely been taken care of
already.

This is mostly the result of new fids being added to the head of the
list. Since the list is now a QSIMPLEQ, add new fids at the end instead
to avoid the need to rewind. Take a reference on the fid to ensure it
doesn't go away during v9fs_reopen_fid() and that it can be safely
passed to QSIMPLEQ_NEXT() afterwards. Since the associated put_fid()
can also yield, same is done with the next fid. So the logic here is
to get a reference on a fid and only put it back during the next
iteration after we could get a reference on the next fid.

Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Message-Id: <20210121181510.1459390-1-groug@kaod.org>
Signed-off-by: Greg Kurz <groug@kaod.org>


  Commit: 81f9766b7a16ccfcfd19e0b4525a5eeba862c851
      
https://github.com/qemu/qemu/commit/81f9766b7a16ccfcfd19e0b4525a5eeba862c851
  Author: Greg Kurz <groug@kaod.org>
  Date:   2021-01-22 (Fri, 22 Jan 2021)

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

  Log Message:
  -----------
  9pfs: Convert reclaim list to QSLIST

Use QSLIST instead of open-coding for a slightly improved readability.

No behavioral change.

Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Message-Id: <20210122143514.215780-1-groug@kaod.org>
Signed-off-by: Greg Kurz <groug@kaod.org>


  Commit: 3dcfd4e3f285cd69d7cf581d3a688e421d28e07e
      
https://github.com/qemu/qemu/commit/3dcfd4e3f285cd69d7cf581d3a688e421d28e07e
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2021-01-25 (Mon, 25 Jan 2021)

  Changed paths:
    M hw/9pfs/9p-proxy.c
    M hw/9pfs/9p.c
    M hw/9pfs/9p.h

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/gkurz-gitlab/tags/9p-next-pull-request' 
into staging

This fixes a Coverity report and improves the fid reclaim logic.

# gpg: Signature made Mon 25 Jan 2021 09:37:28 GMT
# gpg:                using RSA key B4828BAF943140CEF2A3491071D4D5E5822F73D6
# gpg: Good signature from "Greg Kurz <groug@kaod.org>" [full]
# gpg:                 aka "Gregory Kurz <gregory.kurz@free.fr>" [full]
# gpg:                 aka "[jpeg image of size 3330]" [full]
# Primary key fingerprint: B482 8BAF 9431 40CE F2A3  4910 71D4 D5E5 822F 73D6

* remotes/gkurz-gitlab/tags/9p-next-pull-request:
  9pfs: Convert reclaim list to QSLIST
  9pfs: Improve unreclaim loop
  9pfs: Convert V9fsFidState::fid_list to QSIMPLEQ
  9pfs: Convert V9fsFidState::clunked to bool
  9pfs/proxy: Check return value of proxy_marshal()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/55d98950a642...3dcfd4e3f285



reply via email to

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