Skip to contentSkip to conversation

virtiofsd/passthrough_ll: Fix wrong output format in lo_setxattr()

PATCH In review Xiao Yang 3 participants 5 messages Jan 21, 2020 – Jan 28, 2020

lore
Share & tools
lore

Xiao Yang

author
#0 lore raw

PATCH 1/1 virtiofsd/passthrough_ll: Fix wrong output format in lo_setxattr()

Actual debug output:
-------------------------------
[2778114403742] [ID: 00000033] lo_setxattr(ino=93998909307364[2778114466291] [ID: 00000033] unique: 56, success, outsize: 16
-------------------------------
Correct debug output:
-------------------------------
383 [2341816212531] [ID: 00000098] lo_setxattr(ino=3, name=user.test value=test size=4)
-------------------------------

Fixes 63bc560920ad ("virtiofsd: print log only when priority is high enough)"
---
 tools/virtiofsd/passthrough_ll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/virtiofsd/passthrough_ll.c +1 -1
index 57f58aef26..ff34e77a23 100644
@@ -2528,7 +2528,7 @@ static void lo_setxattr(fuse_req_t req, fuse_ino_t ino, const char *name,
         goto out;
     }
 
-    fuse_log(FUSE_LOG_DEBUG, "lo_setxattr(ino=%" PRIu64,
+    fuse_log(FUSE_LOG_DEBUG, "lo_setxattr(ino=%" PRIu64
              ", name=%s value=%s size=%zd)\n", ino, name, value, size);
 
     if (inode->is_symlink) {
Signature · 1 line
2.21.0
#1 lore raw
Quoted 20 lines · * Xiao Yang ([email protected]) wrote:

Actual debug output:
-------------------------------
[2778114403742] [ID: 00000033] lo_setxattr(ino=93998909307364[2778114466291] [ID: 00000033] unique: 56, success, outsize: 16
-------------------------------
Correct debug output:
-------------------------------
383 [2341816212531] [ID: 00000098] lo_setxattr(ino=3, name=user.test value=test size=4)
-------------------------------

Fixes 63bc560920ad ("virtiofsd: print log only when priority is high enough)"
---
 tools/virtiofsd/passthrough_ll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/virtiofsd/passthrough_ll.c +0 -0
index 57f58aef26..ff34e77a23 100644

tools/virtiofsd/passthrough_ll.c static void lo_setxattr(fuse_req_t req, fuse_ino_t ino, const char *name, · line 2534

Quoted 8 lines
tools/virtiofsd/passthrough_ll.c +1 -1
@@ -2528,7 +2528,7 @@ static void lo_setxattr(fuse_req_t req, fuse_ino_t ino, const char *name,
         goto out;
     }
 
-    fuse_log(FUSE_LOG_DEBUG, "lo_setxattr(ino=%" PRIu64,
+    fuse_log(FUSE_LOG_DEBUG, "lo_setxattr(ino=%" PRIu64
              ", name=%s value=%s size=%zd)\n", ino, name, value, size);
 
     if (inode->is_symlink) {

Thank you for the fix! I think we need to mark fuse_log as being printf format so hopefully it will spot more of these errors automatically.

Dave

Quoted 10 lines
Signature · 9 lines
2.21.0




_______________________________________________
Virtio-fs mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virtio-fs

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

author
#2 lore raw
Quoted 2 lines · Dr. David Alan Gilbert

Thank you for the fix! I think we need to mark fuse_log as being printf format so hopefully it will spot more of these errors automatically.

Hi Dave,

Do you perfer to write output to stdout rather than stderr? right?(e.g. replace vfprintf with vprintf?)

BTW: Perhaps, log_func() needs to call g_free() after using g_strdup_printf().

Thanks,
Xiao Yang

Quoted 1 line

Dave

#3 lore raw
Quoted 7 lines · * Xiao Yang ([email protected]) wrote:
Quoted 2 lines · Dr. David Alan Gilbert

Thank you for the fix! I think we need to mark fuse_log as being printf format so hopefully it will spot more of these errors automatically.

Hi Dave,

Do you perfer to write output to stdout rather than stderr? right?(e.g. replace vfprintf with vprintf?)

No, I think it's OK as is.

Quoted 2 lines

BTW: Perhaps, log_func() needs to call g_free() after using g_strdup_printf().

No because the pointer is declared with g_autofree - it does the free automatically.

Dave

Quoted 6 lines

Thanks,
Xiao Yang

Quoted 1 line

Dave

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

Reviewed-by on v1 1/1
#4 lore raw
In reply to Xiao Yang
Quoted 20 lines · Xiao Yang

Actual debug output:
-------------------------------
[2778114403742] [ID: 00000033] lo_setxattr(ino=93998909307364[2778114466291] [ID: 00000033] unique: 56, success, outsize: 16
-------------------------------
Correct debug output:
-------------------------------
383 [2341816212531] [ID: 00000098] lo_setxattr(ino=3, name=user.test value=test size=4)
-------------------------------

Fixes 63bc560920ad ("virtiofsd: print log only when priority is high enough)"
---
 tools/virtiofsd/passthrough_ll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/virtiofsd/passthrough_ll.c +0 -0
index 57f58aef26..ff34e77a23 100644

tools/virtiofsd/passthrough_ll.c static void lo_setxattr(fuse_req_t req, fuse_ino_t ino, const char *name, · line 2532

Quoted 6 lines
tools/virtiofsd/passthrough_ll.c +1 -1
@@ -2528,7 +2528,7 @@ static void lo_setxattr(fuse_req_t req, fuse_ino_t ino, const char *name,
         goto out;
     }
 
-    fuse_log(FUSE_LOG_DEBUG, "lo_setxattr(ino=%" PRIu64,
+    fuse_log(FUSE_LOG_DEBUG, "lo_setxattr(ino=%" PRIu64
              ", name=%s value=%s size=%zd)\n", ino, name, value, size);

Ah, my bad, thanks for the fix!

Quoted 12 lines
tools/virtiofsd/passthrough_ll.c +0 -0
     if (inode->is_symlink) {
Signature · 9 lines
2.21.0




_______________________________________________
Virtio-fs mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virtio-fs