[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] virtiofsd: replace warn(3) and warnx(3) wit
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] virtiofsd: replace warn(3) and warnx(3) with fuse_warning() |
Date: |
Tue, 27 Aug 2019 15:14:27 +0100 |
User-agent: |
Mutt/1.12.1 (2019-06-15) |
On Fri, Aug 23, 2019 at 11:09:52PM +0800, piaojun wrote:
>
>
> On 2019/8/23 17:24, Stefan Hajnoczi wrote:
> > Do not use warn(3) and warnx(3) since they print to stderr. When
> > --syslog is used these messages must go to syslog(3) instead.
> >
> > Signed-off-by: Stefan Hajnoczi <address@hidden>
> > ---
> > contrib/virtiofsd/passthrough_ll.c | 36 +++++++++++++++---------------
> > 1 file changed, 18 insertions(+), 18 deletions(-)
> >
> > diff --git a/contrib/virtiofsd/passthrough_ll.c
> > b/contrib/virtiofsd/passthrough_ll.c
> > index ca11764feb..873e0938a7 100644
> > --- a/contrib/virtiofsd/passthrough_ll.c
> > +++ b/contrib/virtiofsd/passthrough_ll.c
> > @@ -628,12 +628,12 @@ retry:
> >
> > res = readlinkat(lo->proc_self_fd, procname, path, PATH_MAX);
> > if (res < 0) {
> > - warn("lo_parent_and_name: readlink failed");
> > + fuse_warning("lo_parent_and_name: readlink failed: %m\n");
> > goto fail_noretry;
> > }
> >
> > if (res >= PATH_MAX) {
> > - warnx("lo_parent_and_name: readlink overflowed");
> > + fuse_warning("lo_parent_and_name: readlink overflowed\n");
> > goto fail_noretry;
> > }
> > path[res] = '\0';
> > @@ -641,7 +641,7 @@ retry:
> > last = strrchr(path, '/');
> > if (last == NULL) {
> > /* Shouldn't happen */
> > - warnx("lo_parent_and_name: INTERNAL ERROR: bad path read from
> > proc");
> > + fuse_warning("lo_parent_and_name: INTERNAL ERROR: bad path read
> > from proc\n");
> > goto fail_noretry;
> > }
> > if (last == path) {
> > @@ -655,13 +655,13 @@ retry:
> > res = fstatat(AT_FDCWD, last == path ? "/" : path, &stat, 0);
> > if (res == -1) {
> > if (!retries)
> > - warn("lo_parent_and_name: failed to stat
> > parent");
> > + fuse_warning("lo_parent_and_name: failed to
> > stat parent: %m\n");
> > goto fail;
> > }
> > p = lo_find(lo, &stat);
> > if (p == NULL) {
> > if (!retries)
> > - warnx("lo_parent_and_name: failed to find
> > parent");
> > + fuse_warning("lo_parent_and_name: failed to
> > find parent\n");
> > goto fail;
> > }
> > }
> > @@ -669,12 +669,12 @@ retry:
> > res = fstatat(p->fd, last, &stat, AT_SYMLINK_NOFOLLOW);
> > if (res == -1) {
> > if (!retries)
> > - warn("lo_parent_and_name: failed to stat last");
> > + fuse_warning("lo_parent_and_name: failed to stat last:
> > %m\n");
> > goto fail_unref;
> > }
> > if (stat.st_dev != inode->key.dev || stat.st_ino != inode->key.ino) {
> > if (!retries)
> > - warnx("lo_parent_and_name: filed to match last");
> > + fuse_warning("lo_parent_and_name: filed to match
> > last\n");
>
> Typo *filed* -> *failed*, and others looks good to me. Feel free to add:
>
> Reviewed-by: Jun Piao <address@hidden>
Thanks for pointing this out. I will send a separate patch to fix it
since it's a pre-existing typo and not related to the
s/warnx/fuse_warning/ change in this patch.
Stefan
signature.asc
Description: PGP signature