Re: [PATCH] NTFS fix for bug report

Jan Kara (
Thu, 13 Sep 2001 13:34:57 +0200


> Please apply below patch. It should fix the reported hang on NTFS in Win2k
> together with a few more bugs I came across while tracking it down.
> Patch is against 2.4.7-pre10 but it should apply cleanly to the latest
> -ac. (I haven't tested -ac but NTFS should be identical in both trees at
> the moment so it can#t go wrong... <famous last words>)
Actually I've seen the hang in getdir_unsorted() in 2.4.9-ac10 on directories
larger than 4Kb on NT 4.0 drive. I'll try your patch and tell the result :).
BTW: when I was looking into the code (if I see some obvious reason for deadlock)
I found following chunk of code in inode.c in ntfs_readwrite_attr():
/* Read uninitialized data. */
if (offset >= attr->initialized)
return ntfs_read_zero(dest, l);
if (offset + l > attr->initialized) {
dest->size = chunk = offset + l - attr->initialized;
shouldn't this rather be 'attr->initialized-offset'? It would make more sence
for me to call ntfs_readwrite_attr() from 'offset' to read initialized data
and then zero the rest...
error = ntfs_readwrite_attr(ino, attr, offset, dest);
if (error)
return error;
return ntfs_read_zero(dest, l - chunk);

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at