Changes by: yura
Update of /cvs/linux-ntfs/ntfsprogs/ntfsprogs
In directory delta357:/tmp/cvs-serv22952/ntfsprogs
Modified Files:
ntfsmount.c
Log Message:
add support for read errors in free disk space calculation (szaka)
Index: ntfsmount.c
===================================================================
RCS file: /cvs/linux-ntfs/ntfsprogs/ntfsprogs/ntfsmount.c,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -p -r1.95 -r1.96
--- ntfsmount.c 17 Nov 2006 22:14:55 -0000 1.95
+++ ntfsmount.c 17 Nov 2006 22:35:21 -0000 1.96
@@ -151,13 +151,13 @@ static long ntfs_fuse_get_nr_free_mft_re
return ctx->free_mft;
buf = ntfs_malloc(vol->cluster_size);
if (!buf)
- return -ENOMEM;
+ return -errno;
while (1) {
int i, j;
br = ntfs_attr_pread(vol->mftbmp_na, total,
vol->cluster_size, buf);
- if (!br)
+ if (br <= 0)
break;
total += br;
for (i = 0; i < br; i++)
@@ -166,7 +166,7 @@ static long ntfs_fuse_get_nr_free_mft_re
nr_free++;
}
free(buf);
- if (!total)
+ if (!total || br < 0)
return -errno;
ctx->free_mft = nr_free;
ctx->state &= ~(NF_FreeMFTOutdate);
@@ -183,13 +183,13 @@ static long ntfs_fuse_get_nr_free_cluste
return ctx->free_clusters;
buf = ntfs_malloc(vol->cluster_size);
if (!buf)
- return -ENOMEM;
+ return -errno;
while (1) {
int i, j;
br = ntfs_attr_pread(vol->lcnbmp_na, total,
vol->cluster_size, buf);
- if (!br)
+ if (br <= 0)
break;
total += br;
for (i = 0; i < br; i++)
@@ -198,7 +198,7 @@ static long ntfs_fuse_get_nr_free_cluste
nr_free++;
}
free(buf);
- if (!total)
+ if (!total || br < 0)
return -errno;
ctx->free_clusters = nr_free;
ctx->state &= ~(NF_FreeClustersOutdate);
|