All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Btrfs: do not mount when we have a sectorsize larger than PAGE_SIZE
@ 2012-04-02 11:28 Liu Bo
  2012-04-02 12:17 ` David Sterba
  0 siblings, 1 reply; 4+ messages in thread
From: Liu Bo @ 2012-04-02 11:28 UTC (permalink / raw)
  To: linux-btrfs

Our code is not ready to cope with a sectorsize that's larger than PAGE_SIZE.

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
---
 fs/btrfs/disk-io.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 20196f4..08e49d2 100644
--- 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",
+		       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;
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-04-04  9:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2012-04-04  9:17     ` James Courtier-Dutton

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.