From: David Howells Date: Thu, 23 Apr 2009 15:41:18 +0000 (+0100) Subject: ROMFS: Advance destination buffer pointer when reading from a blockdev X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=4b2b0b9753194cad44d7295c32044b89710efd70;p=linux-beck.git ROMFS: Advance destination buffer pointer when reading from a blockdev 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 Tested-by: Michal Simek Signed-off-by: Linus Torvalds --- diff --git a/fs/romfs/storage.c b/fs/romfs/storage.c index 66ce9ddfe504..b3208adf8e71 100644 --- a/fs/romfs/storage.c +++ b/fs/romfs/storage.c @@ -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; }