fix extended attribute corruption if new size was smaller (Jean-Pierre Andre)

master
szaka 2009-01-19 02:35:53 +00:00
parent e4bf04aeea
commit 987e6f7bf9
1 changed files with 5 additions and 0 deletions

View File

@ -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)