Re: [PATCH] security: Use VIR_DEBUG instead of VIR_INFO in virSecurityDACSetOwnershipInternal

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

 



On Sat, Jul 15, 2017 at 16:31:39 +0800, xinhua.Cao wrote:
> virSecurityDACSetOwnershipInternal was called by libvirt child process,
> so if we log message by VIR_INFO at normal scene, it would probability occurs dead lock sence,
> then libvirtd will also by dead lock because libvirtd is waitting for child message.
> so our suggest is use VIR_DEBUG instead of VIR_INFO to avoid this sence.

This won't help. VIR_DEBUG and VIR_INFO macros both translate into a
virLogMessage call thus follow the same code path. So this patch
definitely will not fix it completely.

If you've witnessed a deadlock, please post a backtrace and a debug log
somewhere, since this needs to be fixed at the root.

> ---
>  src/security/security_dac.c | 22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/src/security/security_dac.c b/src/security/security_dac.c
> index ca7a6af..7bfd090 100644
> --- a/src/security/security_dac.c
> +++ b/src/security/security_dac.c
> @@ -552,8 +552,8 @@ virSecurityDACSetOwnershipInternal(const virSecurityDACData *priv,
>      else if (rc > 0)
>          return 0;
>  
> -    VIR_INFO("Setting DAC user and group on '%s' to '%ld:%ld'",
> -             NULLSTR(src ? src->path : path), (long) uid, (long) gid);
> +    VIR_DEBUG("Setting DAC user and group on '%s' to '%ld:%ld'",
> +              NULLSTR(src ? src->path : path), (long) uid, (long) gid);
>  
>      if (priv && src && priv->chownCallback) {
>          rc = priv->chownCallback(src, uid, gid);
> @@ -591,17 +591,17 @@ virSecurityDACSetOwnershipInternal(const virSecurityDACData *priv,
>  
>      if (rc < 0) {
>          if (errno == EOPNOTSUPP || errno == EINVAL) {
> -            VIR_INFO("Setting user and group to '%ld:%ld' on '%s' not "
> -                     "supported by filesystem",
> -                     (long) uid, (long) gid, path);
> +            VIR_DEBUG("Setting user and group to '%ld:%ld' on '%s' not "
> +                      "supported by filesystem",
> +                      (long) uid, (long) gid, path);
>          } else if (errno == EPERM) {
> -            VIR_INFO("Setting user and group to '%ld:%ld' on '%s' not "
> -                     "permitted",
> -                     (long) uid, (long) gid, path);
> +            VIR_DEBUG("Setting user and group to '%ld:%ld' on '%s' not "
> +                      "permitted",
> +                      (long) uid, (long) gid, path);
>          } else if (errno == EROFS) {
> -            VIR_INFO("Setting user and group to '%ld:%ld' on '%s' not "
> -                     "possible on readonly filesystem",
> -                     (long) uid, (long) gid, path);
> +            VIR_DEBUG("Setting user and group to '%ld:%ld' on '%s' not "
> +                      "possible on readonly filesystem",
> +                      (long) uid, (long) gid, path);

NACK

Attachment: signature.asc
Description: PGP signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux