diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index c2d3485e76c..a166ab4ec2c 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -159,6 +159,9 @@ Release 2.0.5-beta - UNRELEASED Service HEALTHY, and results in null data at ActiveBreadCrumb. (Vinay and todd via todd) + HADOOP-9307. BufferedFSInputStream.read returns wrong results + after certain seeks. (todd) + Release 2.0.4-alpha - 2013-04-25 INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/BufferedFSInputStream.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/BufferedFSInputStream.java index 745148281d2..be86ae84cd3 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/BufferedFSInputStream.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/BufferedFSInputStream.java @@ -69,12 +69,17 @@ implements Seekable, PositionedReadable, HasFileDescriptor { if( pos<0 ) { return; } - // optimize: check if the pos is in the buffer - long end = ((FSInputStream)in).getPos(); - long start = end - count; - if( pos>=start && pos=start && pos