linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* disable loading f2fs module on PAGE_SIZE > 4KB
@ 2018-05-16 11:14 Anatoly Pugachev
  2018-05-18  1:10 ` Jaegeuk Kim
  0 siblings, 1 reply; 5+ messages in thread
From: Anatoly Pugachev @ 2018-05-16 11:14 UTC (permalink / raw)
  To: linux-f2fs-devel

Hello!

The following patch disables loading of f2fs module on architectures
which have PAGE_SIZE > 4096 , since it is impossible to mount f2fs on
such architectures , log messages are:

root@ttip:/1/mator/xfstests-dev# mount -t f2fs /dev/vdiskb1 /mnt
mount: /mnt: wrong fs type, bad option, bad superblock on
/dev/vdiskb1, missing codepage or helper program, or other error.
root@ttip:/1/mator/xfstests-dev# file -s /dev/vdiskb1
/dev/vdiskb1: F2FS filesystem,
UUID=1d8b9ca4-2389-4910-af3b-10998969f09c, volume name ""

May 15 18:03:13 ttip kernel: F2FS-fs (vdiskb1): Invalid
page_cache_size (8192), supports only 4KB
May 15 18:03:13 ttip kernel: F2FS-fs (vdiskb1): Can't find valid F2FS
filesystem in 1th superblock
May 15 18:03:13 ttip kernel: F2FS-fs (vdiskb1): Invalid
page_cache_size (8192), supports only 4KB
May 15 18:03:13 ttip kernel: F2FS-fs (vdiskb1): Can't find valid F2FS
filesystem in 2th superblock
May 15 18:03:13 ttip kernel: F2FS-fs (vdiskb1): Invalid
page_cache_size (8192), supports only 4KB

which was introduced by git commit 5c9b469295fb6b10d98923eab5e79c4edb80ed20

tested on git kernel v4.17-rc5-20-g21b9f1c7e319

Signed-off-by: Anatoly Pugachev <matorola@gmail.com>
---

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 42d564c5ccd0..3071771bf261 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -3063,6 +3063,11 @@ static int __init init_f2fs_fs(void)
 {
        int err;

+       if (PAGE_SIZE > 4096) {
+               printk("F2FS not supported on PAGE_SIZE > 4096\n");
+               return -1;
+       }
+
        f2fs_build_trace_ios();

        err = init_inodecache();

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

^ permalink raw reply related	[flat|nested] 5+ messages in thread
* Re: disable loading f2fs module on PAGE_SIZE > 4KB
@ 2018-05-27 23:06 Anatoly Pugachev
  2018-05-28 11:01 ` Chao Yu
  0 siblings, 1 reply; 5+ messages in thread
From: Anatoly Pugachev @ 2018-05-27 23:06 UTC (permalink / raw)
  To: Chao Yu; +Cc: Jaegeuk Kim, linux-f2fs-devel

Thanks for your comments.

The following patch disables loading of f2fs module on architectures
which have PAGE_SIZE > 4096 , since it is impossible to mount f2fs on
such architectures , log messages are:

# mount -t f2fs /dev/vdiskb1 /mnt
mount: /mnt: wrong fs type, bad option, bad superblock on
/dev/vdiskb1, missing codepage or helper program, or other error.
# file -s /dev/vdiskb1
/dev/vdiskb1: F2FS filesystem,
UUID=1d8b9ca4-2389-4910-af3b-10998969f09c, volume name ""

May 15 18:03:13 ttip kernel: F2FS-fs (vdiskb1): Invalid
page_cache_size (8192), supports only 4KB
May 15 18:03:13 ttip kernel: F2FS-fs (vdiskb1): Can't find valid F2FS
filesystem in 1th superblock
May 15 18:03:13 ttip kernel: F2FS-fs (vdiskb1): Invalid
page_cache_size (8192), supports only 4KB
May 15 18:03:13 ttip kernel: F2FS-fs (vdiskb1): Can't find valid F2FS
filesystem in 2th superblock
May 15 18:03:13 ttip kernel: F2FS-fs (vdiskb1): Invalid
page_cache_size (8192), supports only 4KB

which was introduced by git commit 5c9b469295fb6b10d98923eab5e79c4edb80ed20

tested on git kernel 4.17.0-rc6-00309-gec30dcf7f425

with patch applied:

# modprobe f2fs
modprobe: ERROR: could not insert 'f2fs': Invalid argument
# journalctl -e -k
May 28 01:40:28 v215 kernel: F2FS not supported on PAGE_SIZE(8192) != 4096

v2 changes:
- compare page size to f2fs BLKSIZE
- print current page size on error


Signed-off-by: Anatoly Pugachev <matorola@gmail.com>
---

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 42d564c5ccd0..fd9868f8ed4d 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -3063,6 +3063,12 @@ static int __init init_f2fs_fs(void)
 {
        int err;

+       if (PAGE_SIZE != F2FS_BLKSIZE) {
+               printk("F2FS not supported on PAGE_SIZE(%lu) != %d\n",
+                       PAGE_SIZE, F2FS_BLKSIZE);
+               return -EINVAL;
+       }
+
        f2fs_build_trace_ios();

        err = init_inodecache();

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

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

end of thread, other threads:[~2018-05-28 11:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-16 11:14 disable loading f2fs module on PAGE_SIZE > 4KB Anatoly Pugachev
2018-05-18  1:10 ` Jaegeuk Kim
2018-05-18  1:34   ` Chao Yu
  -- strict thread matches above, loose matches on Subject: below --
2018-05-27 23:06 Anatoly Pugachev
2018-05-28 11:01 ` Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).