Commit 9ca2d34b authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

fuse: dump WRITE argument in debug logs

This provides feedback to file system authors about what we receive
from the kernel. This can help figure out which system is to blame for
data corruption.

Change-Id: I7cd7f340bf705c9972c95cfc6d3d8612f1ce8b34
parent fee50bf0
...@@ -88,8 +88,19 @@ func (r *request) InputDebug() string { ...@@ -88,8 +88,19 @@ func (r *request) InputDebug() string {
names = fmt.Sprintf("%q", r.filenames) names = fmt.Sprintf("%q", r.filenames)
} }
if len(r.arg) > 0 { if l := len(r.arg); l > 0 {
names += fmt.Sprintf(" %db", len(r.arg)) data := ""
if len(r.filenames) == 0 {
dots := ""
if l > 8 {
l = 8
dots = "..."
}
data = fmt.Sprintf("%q%s", r.arg[:l], dots)
}
names += fmt.Sprintf("%s %db", data, len(r.arg))
} }
return fmt.Sprintf("rx %d: %s i%d %s%s", return fmt.Sprintf("rx %d: %s i%d %s%s",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment