From 324ed328f575784a741a025f950faac49712fbab Mon Sep 17 00:00:00 2001 From: "(none)!yura" <(none)!yura> Date: Mon, 11 Oct 2004 16:26:16 +0000 Subject: [PATCH] ntfs_attr_truncate check if newsize is equal to na->data_size and don't do anything in this case (Logical change 1.603) --- libntfs/attrib.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libntfs/attrib.c b/libntfs/attrib.c index bd903b3c..820bc1b0 100644 --- a/libntfs/attrib.c +++ b/libntfs/attrib.c @@ -4242,6 +4242,9 @@ int ntfs_attr_truncate(ntfs_attr *na, const s64 newsize) errno = EINVAL; return -1; } + + if (na->data_size == newsize) + return 0; /* * Encrypted attributes are not supported. We return access denied, * which is what Windows NT4 does, too.