Re: [PATCH] xfs: fix directory readahead offset off-by-one

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 06, 2014 at 12:56:37AM -0700, Christoph Hellwig wrote:
> On Tue, May 06, 2014 at 01:42:08PM +1000, Dave Chinner wrote:
> > Fix the warning by ensuring that the readahead offset is correctly
> > incremented.
> > 
> > Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
> > ---
> >  fs/xfs/xfs_dir2_readdir.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/fs/xfs/xfs_dir2_readdir.c b/fs/xfs/xfs_dir2_readdir.c
> > index 50b72f7..fe2db98 100644
> > --- a/fs/xfs/xfs_dir2_readdir.c
> > +++ b/fs/xfs/xfs_dir2_readdir.c
> > @@ -456,7 +456,7 @@ xfs_dir2_leaf_readbuf(
> >  		/*
> >  		 * Advance offset through the mapping table.
> >  		 */
> > -		for (j = 0; j < mp->m_dirblkfsbs; j++) {
> > +		for (j = 0; j < mp->m_dirblkfsbs; ) {
> >  			/*
> >  			 * The rest of this extent but not more than a dir
> >  			 * block.
> 
> This looks correct, but it would seem a little more idiomatic to write
> this as:
> 
> 		for (j = 0; j < mp->m_dirblkfsbs; j += length) {
> 
> and remove the j increment from the body.

yeah, I can do that.

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs




[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux