All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liu Bo <liubo2009@cn.fujitsu.com>
To: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Btrfs: do not mount when we have a sectorsize larger than PAGE_SIZE
Date: Tue, 03 Apr 2012 09:15:39 +0800	[thread overview]
Message-ID: <4F7A4F3B.3010108@cn.fujitsu.com> (raw)
In-Reply-To: <20120402121724.GD14256@twin.jikos.cz>

On 04/02/2012 08:17 PM, David Sterba wrote:
> On Mon, Apr 02, 2012 at 07:28:18PM +0800, Liu Bo wrote:
>> --- a/fs/btrfs/disk-io.c
>> +++ b/fs/btrfs/disk-io.c
>> @@ -2104,6 +2104,14 @@ int open_ctree(struct super_block *sb,
>>  		err = -EINVAL;
>>  		goto fail_alloc;
>>  	}
>> +	if (btrfs_super_sectorsize(disk_super) > PAGE_CACHE_SIZE) {
>> +		printk(KERN_ERR "BTRFS: couldn't mount because sectorsize(%d)"
>> +		       " was larger than PAGE_SIZE(%lu)\n",
> 
> %llu
> 

err, thanks for caching it.

>> +		       btrfs_super_sectorsize(disk_super),
>> +		       (unsigned long long)PAGE_CACHE_SIZE);
>> +		err = -EINVAL;
>> +		goto fail_alloc;
>> +	}
>>  
>>  	features = btrfs_super_incompat_flags(disk_super);
>>  	features |= BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF;
> 
> We have the opposite check a few lines below
> 
> 2257         if (sectorsize < PAGE_SIZE) {
> 2258                 printk(KERN_WARNING "btrfs: Incompatible sector size "
> 2259                        "found on %s\n", sb->s_id);
> 2260                 goto fail_sb_buffer;
> 2261         }
> 2262
> 
> so sectorsize must be equal to PAGE_SIZE always and one check can catch
> both cases.
> 

But this check is _useless_ when we have a sectorsize which is larger than PAGE_SIZE,
we're not ready for that, too.

We already have one check, so I'll modify this instead. :)

thanks,
liubo

> 
> david
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


  reply	other threads:[~2012-04-03  1:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-02 11:28 [PATCH] Btrfs: do not mount when we have a sectorsize larger than PAGE_SIZE Liu Bo
2012-04-02 12:17 ` David Sterba
2012-04-03  1:15   ` Liu Bo [this message]
2012-04-04  9:17     ` James Courtier-Dutton

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=4F7A4F3B.3010108@cn.fujitsu.com \
    --to=liubo2009@cn.fujitsu.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.