From 987e6f7bf94ae77a14e91736bff06508ad32c196 Mon Sep 17 00:00:00 2001 From: szaka Date: Mon, 19 Jan 2009 02:35:53 +0000 Subject: [PATCH] fix extended attribute corruption if new size was smaller (Jean-Pierre Andre) --- src/ntfs-3g.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c index 515f3704..fd649f32 100644 --- a/src/ntfs-3g.c +++ b/src/ntfs-3g.c @@ -1558,6 +1558,11 @@ static int ntfs_fuse_setxattr(const char *path, const char *name, res = -errno; goto exit; } + } else { + if (ntfs_attr_truncate(na, (s64)size)) { + res = -errno; + goto exit; + } } res = ntfs_attr_pwrite(na, 0, size, value); if (res != (s64) size)