diff options
| -rw-r--r-- | fs/nilfs2/the_nilfs.c | 9 | ||||
| -rw-r--r-- | include/linux/nilfs2_fs.h | 6 |
2 files changed, 14 insertions, 1 deletions
diff --git a/fs/nilfs2/the_nilfs.c b/fs/nilfs2/the_nilfs.c index da67b560f3c3..37de1f062d81 100644 --- a/fs/nilfs2/the_nilfs.c +++ b/fs/nilfs2/the_nilfs.c | |||
| @@ -671,7 +671,7 @@ int init_nilfs(struct the_nilfs *nilfs, struct nilfs_sb_info *sbi, char *data) | |||
| 671 | goto out; | 671 | goto out; |
| 672 | } | 672 | } |
| 673 | 673 | ||
| 674 | blocksize = sb_min_blocksize(sb, BLOCK_SIZE); | 674 | blocksize = sb_min_blocksize(sb, NILFS_MIN_BLOCK_SIZE); |
| 675 | if (!blocksize) { | 675 | if (!blocksize) { |
| 676 | printk(KERN_ERR "NILFS: unable to set blocksize\n"); | 676 | printk(KERN_ERR "NILFS: unable to set blocksize\n"); |
| 677 | err = -EINVAL; | 677 | err = -EINVAL; |
| @@ -690,6 +690,13 @@ int init_nilfs(struct the_nilfs *nilfs, struct nilfs_sb_info *sbi, char *data) | |||
| 690 | goto failed_sbh; | 690 | goto failed_sbh; |
| 691 | 691 | ||
| 692 | blocksize = BLOCK_SIZE << le32_to_cpu(sbp->s_log_block_size); | 692 | blocksize = BLOCK_SIZE << le32_to_cpu(sbp->s_log_block_size); |
| 693 | if (blocksize < NILFS_MIN_BLOCK_SIZE || | ||
| 694 | blocksize > NILFS_MAX_BLOCK_SIZE) { | ||
| 695 | printk(KERN_ERR "NILFS: couldn't mount because of unsupported " | ||
| 696 | "filesystem blocksize %d\n", blocksize); | ||
| 697 | err = -EINVAL; | ||
| 698 | goto failed_sbh; | ||
| 699 | } | ||
| 693 | if (sb->s_blocksize != blocksize) { | 700 | if (sb->s_blocksize != blocksize) { |
| 694 | int hw_blocksize = bdev_logical_block_size(sb->s_bdev); | 701 | int hw_blocksize = bdev_logical_block_size(sb->s_bdev); |
| 695 | 702 | ||
diff --git a/include/linux/nilfs2_fs.h b/include/linux/nilfs2_fs.h index 970828a5ffc5..f5487b6f91ed 100644 --- a/include/linux/nilfs2_fs.h +++ b/include/linux/nilfs2_fs.h | |||
| @@ -287,6 +287,12 @@ struct nilfs_super_block { | |||
| 287 | #define NILFS_NAME_LEN 255 | 287 | #define NILFS_NAME_LEN 255 |
| 288 | 288 | ||
| 289 | /* | 289 | /* |
| 290 | * Block size limitations | ||
| 291 | */ | ||
| 292 | #define NILFS_MIN_BLOCK_SIZE 1024 | ||
| 293 | #define NILFS_MAX_BLOCK_SIZE 65536 | ||
| 294 | |||
| 295 | /* | ||
| 290 | * The new version of the directory entry. Since V0 structures are | 296 | * The new version of the directory entry. Since V0 structures are |
| 291 | * stored in intel byte order, and the name_len field could never be | 297 | * stored in intel byte order, and the name_len field could never be |
| 292 | * bigger than 255 chars, it's safe to reclaim the extra byte for the | 298 | * bigger than 255 chars, it's safe to reclaim the extra byte for the |
