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 <stefa...@redhat.com>
> ---
> 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 <piao...@huawei.com>
Jun