public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: Rich Johnston <rjohnston@sgi.com>
Cc: xfs@oss.sgi.com
Subject: Re: xfsrestore: fix 2GB directory dump limitation for multi-stream
Date: Wed, 2 Sep 2015 09:21:17 -0400	[thread overview]
Message-ID: <20150902132117.GC23587@bfoster.bfoster> (raw)
In-Reply-To: <20150827185445.6E13960EDE2F0@gulag1.americas.sgi.com>

On Thu, Aug 27, 2015 at 01:54:45PM -0500, Rich Johnston wrote:
> 
> The drive_simple restore path has a 2GB directory limit. Instead of
> ASSERTing if nreadneeded64 is greater than INTGENMAX (2GB), add a loop
> to handle it.
> 
> Signed-off-by: Rich Johnston <rjohnston@sgi.com>
> ---

I'm not a huge fan of all the spaces used in this code (around the
braces and whatnot). It is consistent with the rest of the code but I'd
probably get away from that as code is modified.

That aside, the change seems fine to me:

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  common/drive_simple.c |   24 +++++++++++++-----------
>  1 file changed, 13 insertions(+), 11 deletions(-)
> 
> Index: b/common/drive_simple.c
> ===================================================================
> --- a/common/drive_simple.c
> +++ b/common/drive_simple.c
> @@ -765,18 +765,20 @@ do_seek_mark( drive_t *drivep, drive_mar
>  	/* use read_buf util func to eat up difference
>  	 */
>  	nreadneeded64 = mark - strmoff;
> -	ASSERT( nreadneeded64 <= INTGENMAX );
> -	nreadneeded = ( intgen_t )nreadneeded64;
> -	nread = read_buf( 0,
> -			  ( size_t )nreadneeded,
> -			  ( void * )drivep,
> -			  ( rfp_t )drivep->d_opsp->do_read,
> -			  ( rrbfp_t )drivep->d_opsp->do_return_read_buf,
> -			  &rval );
> -	if  ( rval ) {
> -		return rval;
> +	while ( nreadneeded64 > 0 ) {
> +		if ( nreadneeded64 > INTGENMAX )
> +			nreadneeded = INTGENMAX;
> +		else
> +			nreadneeded = ( intgen_t )nreadneeded64;
> +		nread = read_buf( 0, nreadneeded, drivep,
> +				  ( rfp_t )drivep->d_opsp->do_read,
> +				( rrbfp_t )drivep->d_opsp->do_return_read_buf,
> +				  &rval );
> +		if  ( rval ) {
> +			return rval;
> +		}
> +		nreadneeded64 -= nread;
>  	}
> -	ASSERT( nread == nreadneeded );
>  
>  	/* verify we are on the mark
>  	 */
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

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

      parent reply	other threads:[~2015-09-02 13:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-27 18:54 xfsrestore: fix 2GB directory dump limitation for multi-stream Rich Johnston
2015-09-01 19:37 ` Rich Johnston
2015-09-02 13:21 ` Brian Foster [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150902132117.GC23587@bfoster.bfoster \
    --to=bfoster@redhat.com \
    --cc=rjohnston@sgi.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox