lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZwQRMe9a6oXKLCq5@google.com>
Date: Mon, 7 Oct 2024 16:49:53 +0000
From: Jaegeuk Kim <jaegeuk@...nel.org>
To: Zhiguo Niu <niuzhiguo84@...il.com>
Cc: Zhiguo Niu <zhiguo.niu@...soc.com>, chao@...nel.org,
	linux-f2fs-devel@...ts.sourceforge.net,
	linux-kernel@...r.kernel.org, xiuhong.wang@...soc.com
Subject: Re: [PATCH] f2fs-toos: use getpagesize() to get default blocksize in
 Android

On 09/19, Zhiguo Niu wrote:
> Hi all,
> please ignore this patch,  we can resove this by "-b" parameter .
> thanks!

Ok, thanks.

> Zhiguo Niu <zhiguo.niu@...soc.com> 于2024年9月14日周六 11:12写道:
> >
> > When 16K page/block size is enabled in Android platform,
> > a error maybe detected in mount process in kernel if "-b"
> > parameters is not specified in mkfs.f2fs.
> > Just as the following check:
> > if (le32_to_cpu(raw_super->log_blocksize) != F2FS_BLKSIZE_BITS)
> >
> > So use getpagesize() to get correct default blocksize.
> >
> > Signed-off-by: Zhiguo Niu <zhiguo.niu@...soc.com>
> > Signed-off-by: Xiuhong Wang <xiuhong.wang@...soc.com>
> > ---
> >  lib/libf2fs.c | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/lib/libf2fs.c b/lib/libf2fs.c
> > index ecd22d4..98ee0ae 100644
> > --- a/lib/libf2fs.c
> > +++ b/lib/libf2fs.c
> > @@ -685,8 +685,17 @@ void f2fs_init_configuration(void)
> >
> >         memset(&c, 0, sizeof(struct f2fs_configuration));
> >         c.ndevs = 1;
> > +#ifdef WITH_ANDROID
> > +       c.blksize = getpagesize();
> > +       c.blksize_bits = log_base_2(c.blksize);
> > +       if ((1 << c.blksize_bits) != c.blksize) {
> > +               c.blksize = 1 << DEFAULT_BLKSIZE_BITS;
> > +               c.blksize_bits = DEFAULT_BLKSIZE_BITS;
> > +       }
> > +#else
> >         c.blksize = 1 << DEFAULT_BLKSIZE_BITS;
> >         c.blksize_bits = DEFAULT_BLKSIZE_BITS;
> > +#endif
> >         c.sectors_per_blk = DEFAULT_SECTORS_PER_BLOCK;
> >         c.blks_per_seg = DEFAULT_BLOCKS_PER_SEGMENT;
> >         c.wanted_total_sectors = -1;
> > --
> > 1.9.1
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ