public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Russell Cattelan <cattelan@thebarn.com>
To: Christoph Hellwig <hch@infradead.org>,
	xfs@oss.sgi.com, John Stanley <jpsinthemix@verizon.net>
Subject: Re: [PATCH, RFC] directory offset overflows in 2.6.28
Date: Mon, 29 Dec 2008 22:16:12 -0600	[thread overview]
Message-ID: <4959A08C.3030003@thebarn.com> (raw)
In-Reply-To: <20081230001117.GA5220@disturbed>

Dave Chinner wrote:
> On Mon, Dec 29, 2008 at 05:07:45PM -0500, Christoph Hellwig wrote:
>   
>> The patch below is a dumb version of just putting back the masking,
>> to make sure we have the same behavior as in 2.6.27 and earlier.
>> I think we should at least hide it in a macro that is well-commented,
>> but I suspect we also need to make sure that we never ever get bigger
>> offsets in directories in some way.
>>     
>
> I think we need that macro sooner rather than later ;)
>
>   
>> Index: xfs/fs/xfs/xfs_dir2_block.c
>> ===================================================================
>> --- xfs.orig/fs/xfs/xfs_dir2_block.c	2008-12-29 21:25:29.680613664 +0100
>> +++ xfs/fs/xfs/xfs_dir2_block.c	2008-12-29 21:29:57.341627581 +0100
>> @@ -517,9 +517,9 @@ xfs_dir2_block_getdents(
>>  		/*
>>  		 * If it didn't fit, set the final offset to here & return.
>>  		 */
>> -		if (filldir(dirent, dep->name, dep->namelen, cook,
>> +		if (filldir(dirent, dep->name, dep->namelen, cook & 0x7fffffff,
>>  			    ino, DT_UNKNOWN)) {
>> -			*offset = cook;
>> +			*offset = cook & 0x7fffffff;
>>  			xfs_da_brelse(NULL, bp);
>>  			return 0;
>>  		}
>>     
>
> In this case, you can do the masking at the time cook is
> assigned. I haven't checked, but I suspect the rest will be the
> same. That will make the patch less invasive and with a macro
> somewhat cleaner...
>
> Cheers,
>
> Dave.
>   
I'm still sorting out the readdir changes in the FreeBSD port so I'm not 
exactly sure how this would
affect things there but I'm thinking FreeBSD does not have 32 bit 
readdir offset limits, so this change
might be another undo patch I would have to maintain.
So I agree, lets make this less invasive.

I've managed to change things at bit by passing an opaque ptr  
containing the  uuio struct into a freebsd "filldir" function  so my xfs 
changes so far
are minimal.


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

  reply	other threads:[~2008-12-30  4:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-29 22:07 [PATCH, RFC] directory offset overflows in 2.6.28 Christoph Hellwig
2008-12-30  0:11 ` Dave Chinner
2008-12-30  4:16   ` Russell Cattelan [this message]
2008-12-30 15:57   ` Christoph Hellwig
2008-12-30 23:34     ` Dave Chinner

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=4959A08C.3030003@thebarn.com \
    --to=cattelan@thebarn.com \
    --cc=hch@infradead.org \
    --cc=jpsinthemix@verizon.net \
    --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