aboutsummaryrefslogtreecommitdiffstats
path: root/fs/romfs/storage.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2009-04-23 11:41:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-24 16:28:31 -0400
commit4b2b0b9753194cad44d7295c32044b89710efd70 (patch)
tree7ff42b7aa3f05bcf61cfdb7abb2c23418b218291 /fs/romfs/storage.c
parent84baf74bf23bbe9f3deafb5d2f27e2b5dc0bc052 (diff)
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 <dhowells@redhat.com> Tested-by: Michal Simek <monstr@monstr.eu> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/romfs/storage.c')
-rw-r--r--fs/romfs/storage.c1
1 files changed, 1 insertions, 0 deletions
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,
120 return -EIO; 120 return -EIO;
121 memcpy(buf, bh->b_data + offset, segment); 121 memcpy(buf, bh->b_data + offset, segment);
122 brelse(bh); 122 brelse(bh);
123 buf += segment;
123 buflen -= segment; 124 buflen -= segment;
124 pos += segment; 125 pos += segment;
125 } 126 }