From 81866620a905bce245d4545208d6537ca41e105c Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Mon, 1 May 2017 14:57:46 -0700 Subject: [PATCH] scoutfs: allow xattrs with 0 length values xattrs can have 0 lenth values so fix the item iterator to emit a single item in the case where the size is 0. Signed-off-by: Zach Brown --- kmod/src/xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kmod/src/xattr.c b/kmod/src/xattr.c index f2fd9289..a427763d 100644 --- a/kmod/src/xattr.c +++ b/kmod/src/xattr.c @@ -118,7 +118,7 @@ static void set_xattr_key_part(struct scoutfs_key_buf *key, u8 part) */ #define for_each_xattr_item(key, val, vh, buffer, size, part, off, bytes) \ for (part = 0, off = 0; \ - off < size && \ + ((off < size) || (part == 0 && size == 0)) && \ (bytes = min_t(size_t, SCOUTFS_XATTR_PART_SIZE, size - off), \ set_xattr_key_part(key, part), \ (vh)->part_len = cpu_to_le16(bytes), \