summaryrefslogtreecommitdiff
path: root/lib/btrfs/btrfsitem
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-02-12 11:29:56 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-02-12 14:28:49 -0700
commit09190693dfc81471b5edf3705a77fc54a89e8782 (patch)
tree2e4323201faff7dd40a8627b048711dfe52f6d32 /lib/btrfs/btrfsitem
parentffabc8c276fcdc97bc15193d511622c4356cdcf0 (diff)
btrfsitem: DirEntry: Fix XATTR name/value ordering
Diffstat (limited to 'lib/btrfs/btrfsitem')
-rw-r--r--lib/btrfs/btrfsitem/item_dir.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/btrfs/btrfsitem/item_dir.go b/lib/btrfs/btrfsitem/item_dir.go
index b3e33f4..584e44d 100644
--- a/lib/btrfs/btrfsitem/item_dir.go
+++ b/lib/btrfs/btrfsitem/item_dir.go
@@ -49,10 +49,10 @@ func (o *DirEntry) UnmarshalBinary(dat []byte) (int, error) {
if err := binutil.NeedNBytes(dat, 0x1e+int(o.DataLen)+int(o.NameLen)); err != nil {
return 0, err
}
- o.Data = dat[n : n+int(o.DataLen)]
- n += int(o.DataLen)
o.Name = dat[n : n+int(o.NameLen)]
n += int(o.NameLen)
+ o.Data = dat[n : n+int(o.DataLen)]
+ n += int(o.DataLen)
return n, nil
}
@@ -63,8 +63,8 @@ func (o DirEntry) MarshalBinary() ([]byte, error) {
if err != nil {
return dat, err
}
- dat = append(dat, o.Data...)
dat = append(dat, o.Name...)
+ dat = append(dat, o.Data...)
return dat, nil
}