* [PATCH] Btrfs: do not mount when we have a sectorsize unequal to PAGE_SIZE
@ 2012-04-03 1:56 Liu Bo
2012-04-03 8:06 ` Karel Zak
0 siblings, 1 reply; 4+ messages in thread
From: Liu Bo @ 2012-04-03 1:56 UTC (permalink / raw)
To: linux-btrfs
Our code is not ready to cope with a sectorsize that's not equal to PAGE_SIZE.
It will lead to hanging-on while writing something.
Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
---
fs/btrfs/disk-io.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 20196f4..b9866f2 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -2254,9 +2254,9 @@ int open_ctree(struct super_block *sb,
goto fail_sb_buffer;
}
- if (sectorsize < PAGE_SIZE) {
- printk(KERN_WARNING "btrfs: Incompatible sector size "
- "found on %s\n", sb->s_id);
+ if (sectorsize != PAGE_SIZE) {
+ printk(KERN_WARNING "btrfs: Incompatible sector size(%lu) "
+ "found on %s\n", (unsigned long)sectorsize, sb->s_id);
goto fail_sb_buffer;
}
--
1.6.5.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Btrfs: do not mount when we have a sectorsize unequal to PAGE_SIZE
2012-04-03 1:56 [PATCH] Btrfs: do not mount when we have a sectorsize unequal to PAGE_SIZE Liu Bo
@ 2012-04-03 8:06 ` Karel Zak
2012-04-03 8:35 ` Liu Bo
0 siblings, 1 reply; 4+ messages in thread
From: Karel Zak @ 2012-04-03 8:06 UTC (permalink / raw)
To: Liu Bo; +Cc: linux-btrfs
On Tue, Apr 03, 2012 at 09:56:53AM +0800, Liu Bo wrote:
> Our code is not ready to cope with a sectorsize that's not equal to PAGE_SIZE.
> It will lead to hanging-on while writing something.
>
> Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
> ---
> fs/btrfs/disk-io.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index 20196f4..b9866f2 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -2254,9 +2254,9 @@ int open_ctree(struct super_block *sb,
> goto fail_sb_buffer;
> }
>
> - if (sectorsize < PAGE_SIZE) {
> - printk(KERN_WARNING "btrfs: Incompatible sector size "
> - "found on %s\n", sb->s_id);
> + if (sectorsize != PAGE_SIZE) {
> + printk(KERN_WARNING "btrfs: Incompatible sector size(%lu) "
> + "found on %s\n", (unsigned long)sectorsize, sb->s_id);
That's strange. Does it mean that if I create the filesystem and then
reboot to another kernel with different PAGE_SIZE then the filesystem
is unaccessible for me?
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Btrfs: do not mount when we have a sectorsize unequal to PAGE_SIZE
2012-04-03 8:06 ` Karel Zak
@ 2012-04-03 8:35 ` Liu Bo
2012-04-03 13:18 ` David Sterba
0 siblings, 1 reply; 4+ messages in thread
From: Liu Bo @ 2012-04-03 8:35 UTC (permalink / raw)
To: Karel Zak; +Cc: linux-btrfs
On 04/03/2012 04:06 PM, Karel Zak wrote:
> On Tue, Apr 03, 2012 at 09:56:53AM +0800, Liu Bo wrote:
>> Our code is not ready to cope with a sectorsize that's not equal to PAGE_SIZE.
>> It will lead to hanging-on while writing something.
>>
>> Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
>> ---
>> fs/btrfs/disk-io.c | 6 +++---
>> 1 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
>> index 20196f4..b9866f2 100644
>> --- a/fs/btrfs/disk-io.c
>> +++ b/fs/btrfs/disk-io.c
>> @@ -2254,9 +2254,9 @@ int open_ctree(struct super_block *sb,
>> goto fail_sb_buffer;
>> }
>>
>> - if (sectorsize < PAGE_SIZE) {
>> - printk(KERN_WARNING "btrfs: Incompatible sector size "
>> - "found on %s\n", sb->s_id);
>> + if (sectorsize != PAGE_SIZE) {
>> + printk(KERN_WARNING "btrfs: Incompatible sector size(%lu) "
>> + "found on %s\n", (unsigned long)sectorsize, sb->s_id);
>
> That's strange. Does it mean that if I create the filesystem and then
> reboot to another kernel with different PAGE_SIZE then the filesystem
> is unaccessible for me?
>
> Karel
>
I'm afraid yes until we can deal with sectorsize and PAGE_SIZE gracefully.
For now, I didn't test if a read will cause oops or not, but if it's ok, an alternative way is to make FS readonly.
thanks,
liubo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Btrfs: do not mount when we have a sectorsize unequal to PAGE_SIZE
2012-04-03 8:35 ` Liu Bo
@ 2012-04-03 13:18 ` David Sterba
0 siblings, 0 replies; 4+ messages in thread
From: David Sterba @ 2012-04-03 13:18 UTC (permalink / raw)
To: Liu Bo; +Cc: Karel Zak, linux-btrfs
On Tue, Apr 03, 2012 at 04:35:28PM +0800, Liu Bo wrote:
> > That's strange. Does it mean that if I create the filesystem and then
> > reboot to another kernel with different PAGE_SIZE then the filesystem
> > is unaccessible for me?
>
> I'm afraid yes until we can deal with sectorsize and PAGE_SIZE
> gracefully.
>
> For now, I didn't test if a read will cause oops or not, but if it's
> ok, an alternative way is to make FS readonly.
Writes will cause hang. I have tested that read-only mount of a 64k
sectorsize is ok, file reads do not hang, but any file larger than the
inline limit is empty due to failed csums.
Example read of
65483 ./drivers/scsi/qla2xxx/qla_isr.c
leads to
[ 9249.370133] btrfs csum failed ino 13837 off 0 csum 4169121208 private 3722900035
while reading
65471 ./arch/powerpc/platforms/cell/spufs/file.c
is just fine.
So for now even forcing a read-only mount is not good option, though we
may try to enhance the csum verification.
david
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-04-03 13:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-03 1:56 [PATCH] Btrfs: do not mount when we have a sectorsize unequal to PAGE_SIZE Liu Bo
2012-04-03 8:06 ` Karel Zak
2012-04-03 8:35 ` Liu Bo
2012-04-03 13:18 ` David Sterba
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.