aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ntfs/attrib.c
diff options
context:
space:
mode:
authorAnton Altaparmakov <aia21@cam.ac.uk>2007-11-03 03:38:59 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-11-03 15:27:21 -0400
commitebab89909e0dc716282d5e7f6e73a3155fe66d4a (patch)
tree8cee9ff6f9e0a08c6f08853e38e563514e92a99e /fs/ntfs/attrib.c
parent74521c28e550c4ec265cda14114bd9b908e9de34 (diff)
NTFS: Fix read regression.
The regression was caused by: commit[a32ea1e1f925399e0d81ca3f7394a44a6dafa12c] Fix read/truncate race This causes ntfs_readpage() to be called for a zero i_size inode, which failed when the file was compressed and non-resident. Thanks a lot to Mike Galbraith for reporting the issue and tracking down the commit that caused the regression. Looking into it I found three bugs which the patch fixes. Signed-off-by: Anton Altaparmakov <aia21@cantab.net> Tested-by: Mike Galbraith <efault@gmx.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ntfs/attrib.c')
-rw-r--r--fs/ntfs/attrib.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/ntfs/attrib.c b/fs/ntfs/attrib.c
index 92dabdcf2b80..50d3b0c258e3 100644
--- a/fs/ntfs/attrib.c
+++ b/fs/ntfs/attrib.c
@@ -179,10 +179,7 @@ int ntfs_map_runlist_nolock(ntfs_inode *ni, VCN vcn, ntfs_attr_search_ctx *ctx)
179 * ntfs_mapping_pairs_decompress() fails. 179 * ntfs_mapping_pairs_decompress() fails.
180 */ 180 */
181 end_vcn = sle64_to_cpu(a->data.non_resident.highest_vcn) + 1; 181 end_vcn = sle64_to_cpu(a->data.non_resident.highest_vcn) + 1;
182 if (!a->data.non_resident.lowest_vcn && end_vcn == 1) 182 if (unlikely(vcn && vcn >= end_vcn)) {
183 end_vcn = sle64_to_cpu(a->data.non_resident.allocated_size) >>
184 ni->vol->cluster_size_bits;
185 if (unlikely(vcn >= end_vcn)) {
186 err = -ENOENT; 183 err = -ENOENT;
187 goto err_out; 184 goto err_out;
188 } 185 }