* [PATCH] libxfs: remove never-read "offset" assignment in readbufr_map & writebufr
@ 2014-04-09 19:20 Eric Sandeen
2014-04-09 20:59 ` Mark Tinguely
0 siblings, 1 reply; 2+ messages in thread
From: Eric Sandeen @ 2014-04-09 19:20 UTC (permalink / raw)
To: xfs-oss
libxfs_readbufr_map() & libxfs_writebufr() iterate
over bp->b_map[] and read each chunk. The loops start
out correctly, getting the offset from bm_bn and the
length from bm_len. After the IO it correctly
advances the target buffer pointer by len, but then
inexplicably advances "offset" by len as well. The
whole point of this exercise is to handle discontiguous
ranges - marching offset along by length of IO done
is incorrect.
Thankfully offset is immediately reset to the proper
value again at the top of the loop for the next range,
so this is harmless, other than being confusing.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c
index 9887423..7208a2f 100644
--- a/libxfs/rdwr.c
+++ b/libxfs/rdwr.c
@@ -758,7 +758,6 @@ libxfs_readbufr_map(struct xfs_buftarg *btp, struct xfs_buf *bp, int flags)
break;
}
buf += len;
- offset += len;
}
if (!error)
@@ -878,7 +877,6 @@ libxfs_writebufr(xfs_buf_t *bp)
break;
}
buf += len;
- offset += len;
}
}
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] libxfs: remove never-read "offset" assignment in readbufr_map & writebufr
2014-04-09 19:20 [PATCH] libxfs: remove never-read "offset" assignment in readbufr_map & writebufr Eric Sandeen
@ 2014-04-09 20:59 ` Mark Tinguely
0 siblings, 0 replies; 2+ messages in thread
From: Mark Tinguely @ 2014-04-09 20:59 UTC (permalink / raw)
To: Eric Sandeen; +Cc: xfs-oss
On 04/09/14 14:20, Eric Sandeen wrote:
> libxfs_readbufr_map()& libxfs_writebufr() iterate
> over bp->b_map[] and read each chunk. The loops start
> out correctly, getting the offset from bm_bn and the
> length from bm_len. After the IO it correctly
> advances the target buffer pointer by len, but then
> inexplicably advances "offset" by len as well. The
> whole point of this exercise is to handle discontiguous
> ranges - marching offset along by length of IO done
> is incorrect.
>
> Thankfully offset is immediately reset to the proper
> value again at the top of the loop for the next range,
> so this is harmless, other than being confusing.
>
> Signed-off-by: Eric Sandeen<sandeen@redhat.com>
Looks good.
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-04-09 20:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-09 19:20 [PATCH] libxfs: remove never-read "offset" assignment in readbufr_map & writebufr Eric Sandeen
2014-04-09 20:59 ` Mark Tinguely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).