From 6719733ddc199376fede0e43490e423ecab3e887 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Fri, 28 Apr 2017 16:32:24 -0700 Subject: [PATCH] scoutfs: output full dirent name when tracing The dirent name formatting code accidentally copied the calculation for the length of the name from the xattrs, which are null terminated. The durents are not, their length is just the value length minus the dirent header. Signed-off-by: Zach Brown --- kmod/src/key.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kmod/src/key.c b/kmod/src/key.c index abcfac9f..584fa2fb 100644 --- a/kmod/src/key.c +++ b/kmod/src/key.c @@ -156,8 +156,7 @@ int scoutfs_key_str(char *buf, struct scoutfs_key_buf *key) case SCOUTFS_DIRENT_KEY: { struct scoutfs_dirent_key *dkey = key->data; - len = (int)key->key_len - offsetof(struct scoutfs_dirent_key, - name[1]); + len = (int)key->key_len - sizeof(struct scoutfs_dirent_key); if (len <= 0) break;