Skip to content

Commit

Permalink
ROMFS: Advance destination buffer pointer when reading from a blockdev
Browse files Browse the repository at this point in the history
RomFS should advance the destination buffer pointer when reading data from a
blockdev source (the data may be split over multiple blocks, each requiring its
own sb_read() call).  Without this, all the data is copied to the beginning of
the output buffer.

Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
David Howells authored and Linus Torvalds committed Apr 24, 2009
1 parent 84baf74 commit 4b2b0b9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/romfs/storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ static int romfs_blk_read(struct super_block *sb, unsigned long pos,
return -EIO;
memcpy(buf, bh->b_data + offset, segment);
brelse(bh);
buf += segment;
buflen -= segment;
pos += segment;
}
Expand Down

0 comments on commit 4b2b0b9

Please sign in to comment.