[PATCH] fs/cramfs: Remove useless call "zlib_inflateEnd"

2021-03-30 Thread Jiapeng Chong
Fix the following whitescan warning: Calling "zlib_inflateEnd(&stream)" is only useful for its return value, which is ignored. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong --- fs/cramfs/uncompress.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/cramfs/uncompress

Re: [PATCH] cramfs: Kconfig: Fix spelling mistake "adresssed" -> "addressed"

2020-11-26 Thread Nicolas Pitre
On Thu, 26 Nov 2020, Colin King wrote: > From: Colin Ian King > > There is a spelling mistake in the Kconfig help text. Fix it. > > Signed-off-by: Colin Ian King Acked-by: Nicolas Pitre > --- > fs/cramfs/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion

[PATCH] cramfs: Kconfig: Fix spelling mistake "adresssed" -> "addressed"

2020-11-26 Thread Colin King
From: Colin Ian King There is a spelling mistake in the Kconfig help text. Fix it. Signed-off-by: Colin Ian King --- fs/cramfs/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cramfs/Kconfig b/fs/cramfs/Kconfig index d98cef0dbb6b..a8af8c6ac15d 100644 --- a/fs

Re: [PATCH 12/17] fs/cramfs: Use memcpy_from_page()

2020-11-24 Thread Nicolas Pitre
On Mon, 23 Nov 2020, ira.we...@intel.com wrote: > From: Ira Weiny > > Remove open coded kmap/memcpy/kunmap and use mempcy_from_page() instead. > > Cc: Nicolas Pitre > Signed-off-by: Ira Weiny Acked-by: Nicolas Pitre > --- > fs/cramfs/inode.c | 3 +-- > 1 file

[PATCH 12/17] fs/cramfs: Use memcpy_from_page()

2020-11-23 Thread ira . weiny
From: Ira Weiny Remove open coded kmap/memcpy/kunmap and use mempcy_from_page() instead. Cc: Nicolas Pitre Signed-off-by: Ira Weiny --- fs/cramfs/inode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c index 4b90cfd1ec36

Re: [PATCH RFC PKS/PMEM 33/58] fs/cramfs: Utilize new kmap_thread()

2020-10-13 Thread Ira Weiny
On Tue, Oct 13, 2020 at 09:01:49PM +0100, Al Viro wrote: > On Tue, Oct 13, 2020 at 08:36:43PM +0100, Matthew Wilcox wrote: > > > static inline void copy_to_highpage(struct page *to, void *vfrom, unsigned > > int size) > > { > > char *vto = kmap_atomic(to); > > > > memcpy(vto, vfrom, size

Re: [PATCH RFC PKS/PMEM 33/58] fs/cramfs: Utilize new kmap_thread()

2020-10-13 Thread Ira Weiny
lized to a single thread. To avoid > > > the over head of global PKRS updates use the new kmap_thread() call. > > > > > > Cc: Nicolas Pitre > > > Signed-off-by: Ira Weiny > > > --- > > > fs/cramfs/inode.c | 10 +- > > > 1

Re: [PATCH RFC PKS/PMEM 33/58] fs/cramfs: Utilize new kmap_thread()

2020-10-13 Thread Al Viro
On Tue, Oct 13, 2020 at 08:36:43PM +0100, Matthew Wilcox wrote: > static inline void copy_to_highpage(struct page *to, void *vfrom, unsigned > int size) > { > char *vto = kmap_atomic(to); > > memcpy(vto, vfrom, size); > kunmap_atomic(vto); > } > > in linux/highmem.h ? You mea

Re: [PATCH RFC PKS/PMEM 33/58] fs/cramfs: Utilize new kmap_thread()

2020-10-13 Thread Dan Williams
o a single thread. To avoid > > > the over head of global PKRS updates use the new kmap_thread() call. > > > > > > Cc: Nicolas Pitre > > > Signed-off-by: Ira Weiny > > > --- > > > fs/cramfs/inode.c | 10 +- > > > 1 file chan

Re: [PATCH RFC PKS/PMEM 33/58] fs/cramfs: Utilize new kmap_thread()

2020-10-13 Thread Matthew Wilcox
ew kmap_thread() call. > > > > Cc: Nicolas Pitre > > Signed-off-by: Ira Weiny > > --- > > fs/cramfs/inode.c | 10 +- > > 1 file changed, 5 insertions(+), 5 deletions(-) > > > > diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c > > index 91

Re: [PATCH RFC PKS/PMEM 33/58] fs/cramfs: Utilize new kmap_thread()

2020-10-13 Thread Dan Williams
On Fri, Oct 9, 2020 at 12:52 PM wrote: > > From: Ira Weiny > > The kmap() calls in this FS are localized to a single thread. To avoid > the over head of global PKRS updates use the new kmap_thread() call. > > Cc: Nicolas Pitre > Signed-off-by: Ira Weiny > --

Re: [PATCH RFC PKS/PMEM 33/58] fs/cramfs: Utilize new kmap_thread()

2020-10-13 Thread Nicolas Pitre
ked-by: Nicolas Pitre > fs/cramfs/inode.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c > index 912308600d39..003c014a42ed 100644 > --- a/fs/cramfs/inode.c > +++ b/fs/cramfs/inode.c > @@ -247,8 +24

[PATCH RFC PKS/PMEM 33/58] fs/cramfs: Utilize new kmap_thread()

2020-10-09 Thread ira . weiny
From: Ira Weiny The kmap() calls in this FS are localized to a single thread. To avoid the over head of global PKRS updates use the new kmap_thread() call. Cc: Nicolas Pitre Signed-off-by: Ira Weiny --- fs/cramfs/inode.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff

[PATCH v2 07/16] cramfs: Tell the VFS that readpage was synchronous

2020-10-09 Thread Matthew Wilcox (Oracle)
The cramfs readpage implementation was already synchronous, so use AOP_UPDATED_PAGE to avoid cycling the page lock. Signed-off-by: Matthew Wilcox (Oracle) --- fs/cramfs/inode.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c index

[PATCH 06/13] cramfs: Tell the VFS that readpage was synchronous

2020-09-17 Thread Matthew Wilcox (Oracle)
The cramfs readpage implementation was already synchronous, so use AOP_UPDATED_PAGE to avoid cycling the page lock. Signed-off-by: Matthew Wilcox (Oracle) --- fs/cramfs/inode.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c index

Re: [RFC PATCH 48/68] vfs: Convert cramfs to use the new mount API

2019-04-01 Thread Nicolas Pitre
On Wed, 27 Mar 2019, David Howells wrote: > Convert the cramfs filesystem to the new internal mount API as the old > one will be obsoleted and removed. This allows greater flexibility in > communication of mount parameters between userspace, the VFS and the > filesystem. > >

[RFC PATCH 3/6] cramfs: Convert to fs_context

2019-03-21 Thread David Howells
Signed-off-by: David Howells cc: Nicolas Pitre cc: linux-...@lists.infradead.org cc: linux-bl...@vger.kernel.org --- fs/cramfs/inode.c | 69 ++--- 1 file changed, 39 insertions(+), 30 deletions(-) diff --git a/fs/cramfs/inode.c b/fs/cramfs

[RFC PATCH 0/6] mtd, romfs, cramfs, jffs2, squashfs: Convert to fs_context

2019-03-20 Thread David Howells
Here's a set of patches that convert romfs, cramfs, jffs2 and squashfs to use the new fs_context struct and replace mount_mtd(). They have prerequisite commits (such as replacing mount_bdev()) that can be found in the branch detailed below. (1) Provide a replacement for mount_mtd() that

[RFC PATCH 3/6] cramfs: Convert to fs_context

2019-03-20 Thread David Howells
Signed-off-by: David Howells cc: Nicolas Pitre cc: linux-...@lists.infradead.org cc: linux-bl...@vger.kernel.org --- fs/cramfs/inode.c | 69 ++--- 1 file changed, 39 insertions(+), 30 deletions(-) diff --git a/fs/cramfs/inode.c b/fs/cramfs

[PATCH 3.16 128/305] Cramfs: fix abad comparison when wrap-arounds occur

2019-02-03 Thread Ben Hutchings
, and wrongly pass the buffer size test. Reported-by: Anatoly Trosinenko Signed-off-by: Nicolas Pitre Signed-off-by: Ben Hutchings --- fs/cramfs/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/fs/cramfs/inode.c +++ b/fs/cramfs/inode.c @@ -183,7 +183,8 @@ static void

[PATCH 3.18 52/90] Cramfs: fix abad comparison when wrap-arounds occur

2018-11-19 Thread Greg Kroah-Hartman
, and wrongly pass the buffer size test. Reported-by: Anatoly Trosinenko Signed-off-by: Nicolas Pitre Cc: sta...@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- fs/cramfs/inode.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/fs/cramfs/inode.c +++ b/fs/cramfs/inode.c

[PATCH 4.4 081/160] Cramfs: fix abad comparison when wrap-arounds occur

2018-11-19 Thread Greg Kroah-Hartman
, and wrongly pass the buffer size test. Reported-by: Anatoly Trosinenko Signed-off-by: Nicolas Pitre Cc: sta...@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- fs/cramfs/inode.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/fs/cramfs/inode.c +++ b/fs/cramfs/inode.c

[PATCH 4.19 318/361] Cramfs: fix abad comparison when wrap-arounds occur

2018-11-11 Thread Greg Kroah-Hartman
, and wrongly pass the buffer size test. Reported-by: Anatoly Trosinenko Signed-off-by: Nicolas Pitre Cc: sta...@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- fs/cramfs/inode.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/fs/cramfs/inode.c +++ b/fs/cramfs/inode.c

[PATCH 4.18 309/350] Cramfs: fix abad comparison when wrap-arounds occur

2018-11-11 Thread Greg Kroah-Hartman
, and wrongly pass the buffer size test. Reported-by: Anatoly Trosinenko Signed-off-by: Nicolas Pitre Cc: sta...@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- fs/cramfs/inode.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/fs/cramfs/inode.c +++ b/fs/cramfs/inode.c

[PATCH 4.14 191/222] Cramfs: fix abad comparison when wrap-arounds occur

2018-11-11 Thread Greg Kroah-Hartman
, and wrongly pass the buffer size test. Reported-by: Anatoly Trosinenko Signed-off-by: Nicolas Pitre Cc: sta...@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- fs/cramfs/inode.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/fs/cramfs/inode.c +++ b/fs/cramfs/inode.c

[PATCH 4.9 127/141] Cramfs: fix abad comparison when wrap-arounds occur

2018-11-11 Thread Greg Kroah-Hartman
, and wrongly pass the buffer size test. Reported-by: Anatoly Trosinenko Signed-off-by: Nicolas Pitre Cc: sta...@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- fs/cramfs/inode.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/fs/cramfs/inode.c +++ b/fs/cramfs/inode.c

Re: Cramfs: "unable to handle kernel paging request" when reading a file from a fuzzed FS image

2018-10-31 Thread Anatoly Trosinenko
Tested in fresh torvalds/master branch. Thank you! Best regards Anatoly пн, 29 окт. 2018 г. в 19:03, Nicolas Pitre : > > On Mon, 29 Oct 2018, Anatoly Trosinenko wrote: > > > > How do I populate /vtmp? Mine is empty at this point. I imagine I > > > should put the cramfs

Re: [GIT PULL] Cramfs fixes

2018-10-30 Thread Nicolas Pitre
On Tue, 30 Oct 2018, Linus Torvalds wrote: > On Tue, Oct 30, 2018 at 12:09 PM Nicolas Pitre > wrote: > > > > Make the Cramfs code more robust against filesystem corruptions, > > plus trivial indentation fixes. > > Shortlog? Sorry, I will next time. > Anyway, pulled. Thanks. Nicolas

Re: [GIT PULL] Cramfs fixes

2018-10-30 Thread Linus Torvalds
On Tue, Oct 30, 2018 at 12:09 PM Nicolas Pitre wrote: > > Make the Cramfs code more robust against filesystem corruptions, > plus trivial indentation fixes. Shortlog? Anyway, pulled. Linus

[GIT PULL] Cramfs fixes

2018-10-30 Thread Nicolas Pitre
Linus, Please pull from: git://git.linaro.org/people/nicolas.pitre/linux tags/cramfs_fixes Make the Cramfs code more robust against filesystem corruptions, plus trivial indentation fixes. Tag: 37b13f91069f87579018f4870da082bd172be005 Branch: 56ce68bceeefa38e5b3509bf3d39259138e2d76a fs

Re: Cramfs: "unable to handle kernel paging request" when reading a file from a fuzzed FS image

2018-10-29 Thread Nicolas Pitre
On Mon, 29 Oct 2018, Anatoly Trosinenko wrote: > > How do I populate /vtmp? Mine is empty at this point. I imagine I > > should put the cramfs image somewhere on the host, but I'm not that > > familiar withkvm. > > Oops, forgot to say, it is the /tmp/kvm-xfstests-$

Re: Cramfs: "unable to handle kernel paging request" when reading a file from a fuzzed FS image

2018-10-29 Thread Anatoly Trosinenko
> How do I populate /vtmp? Mine is empty at this point. I imagine I should put the cramfs image somewhere on the host, but I'm not that familiar withkvm. Oops, forgot to say, it is the /tmp/kvm-xfstests-$USER directory on the host (it will be created when you first launch kvm-xfstests a

Re: Cramfs: "unable to handle kernel paging request" when reading a file from a fuzzed FS image

2018-10-28 Thread Nicolas Pitre
On Sun, 28 Oct 2018, Anatoly Trosinenko wrote: > Hello, > > When reading a file from a fuzzed cramfs image, unhandled kernel > paging request occurs. Hmmm... It doesn't show up on my test system. > How to reproduce with kvm-xfstests: > 1) Checkout the v4.19 tag, cop

Re: [PATCH 01/10] cramfs: Convert to use vmf_insert_mixed

2018-08-28 Thread Nicolas Pitre
On Tue, 28 Aug 2018, Matthew Wilcox wrote: > On Tue, Aug 28, 2018 at 01:49:25PM -0400, Nicolas Pitre wrote: > > On Tue, 28 Aug 2018, Matthew Wilcox wrote: > > > - ret = vm_insert_mixed(vma, vma->vm_start + off, pfn); > > > + vmf = vmf_insert_mixed(vma, vma->vm_start

Re: [PATCH 01/10] cramfs: Convert to use vmf_insert_mixed

2018-08-28 Thread Matthew Wilcox
On Tue, Aug 28, 2018 at 01:49:25PM -0400, Nicolas Pitre wrote: > On Tue, 28 Aug 2018, Matthew Wilcox wrote: > > - ret = vm_insert_mixed(vma, vma->vm_start + off, pfn); > > + vmf = vmf_insert_mixed(vma, vma->vm_start + off, pfn); > > + if (vmf &

Re: [PATCH 01/10] cramfs: Convert to use vmf_insert_mixed

2018-08-28 Thread Nicolas Pitre
On Tue, 28 Aug 2018, Matthew Wilcox wrote: > cramfs is the only remaining user of vm_insert_mixed; convert it. > > Signed-off-by: Matthew Wilcox > --- > fs/cramfs/inode.c | 9 +++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/fs/cramfs/ino

[PATCH 01/10] cramfs: Convert to use vmf_insert_mixed

2018-08-28 Thread Matthew Wilcox
cramfs is the only remaining user of vm_insert_mixed; convert it. Signed-off-by: Matthew Wilcox --- fs/cramfs/inode.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c index f408994fc632..b72449c19cd1 100644 --- a/fs/cramfs

Re: [PATCH] cramfs: Fix IS_ENABLED typo

2018-05-13 Thread Al Viro
On Sun, May 13, 2018 at 06:21:18PM -0400, Nicolas Pitre wrote: > On Sun, 13 May 2018, Joe Perches wrote: > > > There's an extra C here... > > > > Fixes: 99c18ce580c6 ("cramfs: direct memory access support") > > Signed-off-by: Joe Perches >

Re: [PATCH] cramfs: Fix IS_ENABLED typo

2018-05-13 Thread Nicolas Pitre
On Sun, 13 May 2018, Joe Perches wrote: > There's an extra C here... > > Fixes: 99c18ce580c6 ("cramfs: direct memory access support") > Signed-off-by: Joe Perches Indeed. Acked-by: Nicolas Pitre @Al: could you pick up this one too? > --- > fs/cramfs/in

[PATCH] cramfs: Fix IS_ENABLED typo

2018-05-13 Thread Joe Perches
There's an extra C here... Fixes: 99c18ce580c6 ("cramfs: direct memory access support") Signed-off-by: Joe Perches --- fs/cramfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c index 017b0ab19bc4..124b093d14e5

[PATCH 23/76] fs/cramfs: Use inode_sb() helper instead of inode->i_sb

2018-05-08 Thread Mark Fasheh
Signed-off-by: Mark Fasheh --- fs/cramfs/inode.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c index 017b0ab19bc4..eb633de7ccbe 100644 --- a/fs/cramfs/inode.c +++ b/fs/cramfs/inode.c @@ -294,7 +294,7 @@ static void

Re: [PATCH] cramfs: better MTD dependency expression

2018-02-08 Thread Nicolas Pitre
On Thu, 8 Feb 2018, Linus Torvalds wrote: > On Wed, Feb 7, 2018 at 7:08 PM, Nicolas Pitre > wrote: > > > > Viro once told me that my cramfs pull requests could go either to him or > > to you. I have only this one patch at the moment, and since it depends > > on a

Re: [PATCH] cramfs: better MTD dependency expression

2018-02-08 Thread Randy Dunlap
On 02/08/2018 11:38 AM, Linus Torvalds wrote: > On Wed, Feb 7, 2018 at 7:08 PM, Nicolas Pitre > wrote: >> >> Viro once told me that my cramfs pull requests could go either to him or >> to you. I have only this one patch at the moment, and since it depends >> on a co

Re: [PATCH] cramfs: better MTD dependency expression

2018-02-08 Thread Linus Torvalds
On Wed, Feb 7, 2018 at 7:08 PM, Nicolas Pitre wrote: > > Viro once told me that my cramfs pull requests could go either to him or > to you. I have only this one patch at the moment, and since it depends > on a commit that recently appeared in your tree I'm therefore sending it

[PATCH] cramfs: better MTD dependency expression

2018-02-07 Thread Nicolas Pitre
Commit b9f5fb1800d8 ("cramfs: fix MTD dependency") did what it says. Since commit 9059a3493efe ("kconfig: fix relational operators for bool and tristate symbols") it is possible to do it slightly better though. Signed-off-by: Nicolas Pitre --- Linus, Viro once told me

fs/cramfs/inode.c:698: undefined reference to `mount_mtd'

2017-12-16 Thread kbuild test robot
Hi Nicolas, FYI, the error/warning still remains. tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: f3b5ad89de16f5d42e8ad36fbdf85f705c1ae051 commit: 99c18ce580c6cc6763e694b4ce320d7b226ab59b cramfs: direct memory access support date: 9 weeks ago config

Re: [PATCH] cramfs: fix MTD dependency

2017-11-21 Thread Nicolas Pitre
On Fri, 10 Nov 2017, Arnd Bergmann wrote: > With CONFIG_MTD=m and CONFIG_CRAMFS=y, we now get a link failure: > > fs/cramfs/inode.o: In function `cramfs_mount': > inode.c:(.text+0x220): undefined reference to `mount_mtd' > fs/cramfs/inode.o: In function `cramfs_mtd_fill

fs/cramfs/inode.c:698: undefined reference to `mount_mtd'

2017-11-21 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: e1d1ea549b57790a3d8cf6300e6ef86118d692a3 commit: 99c18ce580c6cc6763e694b4ce320d7b226ab59b cramfs: direct memory access support date: 5 weeks ago config: i386-randconfig-i1-201747 (attached as .config

[git pull] vfs.git cramfs series

2017-11-16 Thread Al Viro
Nicolas Pitre cramfs work. The following changes since commit 8a5776a5f49812d29fe4b2d0a2d71675c3facf3f: Linux 4.14-rc4 (2017-10-08 20:53:29 -0700) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git work.cramfs for you to fetch

Re: [PATCH] cramfs: fix MTD dependency

2017-11-16 Thread Nicolas Pitre
icolas Pitre > > >> wrote: > > >> > On Fri, 10 Nov 2017, Arnd Bergmann wrote: > > >> > > > >> >> With CONFIG_MTD=m and CONFIG_CRAMFS=y, we now get a link failure: > > >> >> > > >> >> fs/cramfs/i

Re: [PATCH] cramfs: fix MTD dependency

2017-11-15 Thread Nicolas Pitre
d Bergmann wrote: > >> > > >> >> With CONFIG_MTD=m and CONFIG_CRAMFS=y, we now get a link failure: > >> >> > >> >> fs/cramfs/inode.o: In function `cramfs_mount': > >> >> inode.c:(.text+0x220): undefined reference to `mou

Re: [PATCH] cramfs: fix MTD dependency

2017-11-15 Thread Arnd Bergmann
m and CONFIG_CRAMFS=y, we now get a link failure: >> >> >> >> fs/cramfs/inode.o: In function `cramfs_mount': >> >> inode.c:(.text+0x220): undefined reference to `mount_mtd' >> >> fs/cramfs/inode.o: In function `cramfs_mtd_fill_super': >

Re: [PATCH] cramfs: fix MTD dependency

2017-11-10 Thread Nicolas Pitre
On Fri, 10 Nov 2017, Arnd Bergmann wrote: > On Fri, Nov 10, 2017 at 5:35 PM, Nicolas Pitre > wrote: > > On Fri, 10 Nov 2017, Arnd Bergmann wrote: > > > >> With CONFIG_MTD=m and CONFIG_CRAMFS=y, we now get a link failure: > >> > >> fs/cramfs/inod

Re: [PATCH] cramfs: fix MTD dependency

2017-11-10 Thread Arnd Bergmann
On Fri, Nov 10, 2017 at 5:35 PM, Nicolas Pitre wrote: > On Fri, 10 Nov 2017, Arnd Bergmann wrote: > >> With CONFIG_MTD=m and CONFIG_CRAMFS=y, we now get a link failure: >> >> fs/cramfs/inode.o: In function `cramfs_mount': >> inode.c:(.text+0x220): undefined re

Re: [PATCH] cramfs: fix MTD dependency

2017-11-10 Thread Nicolas Pitre
On Fri, 10 Nov 2017, Arnd Bergmann wrote: > With CONFIG_MTD=m and CONFIG_CRAMFS=y, we now get a link failure: > > fs/cramfs/inode.o: In function `cramfs_mount': > inode.c:(.text+0x220): undefined reference to `mount_mtd' > fs/cramfs/inode.o: In function `cramfs_mtd_fill

[PATCH] cramfs: fix MTD dependency

2017-11-10 Thread Arnd Bergmann
With CONFIG_MTD=m and CONFIG_CRAMFS=y, we now get a link failure: fs/cramfs/inode.o: In function `cramfs_mount': inode.c:(.text+0x220): undefined reference to `mount_mtd' fs/cramfs/inode.o: In function `cramfs_mtd_fill_super': inode.c:(.text+0x6d8): undefined reference to `mtd

Re: [PATCH v6 1/4] cramfs: direct memory access support

2017-10-13 Thread Nicolas Pitre
es, that's what I thought you meant, which corresponds to the second > part of my comment above. And as I said I'm not convinced this hiding of > kernel config effects is better for understanding what is actually going > on locally, and my own preference is how things are righ

Re: [PATCH v6 1/4] cramfs: direct memory access support

2017-10-13 Thread Nicolas Pitre
On Sat, 14 Oct 2017, Al Viro wrote: > On Fri, Oct 13, 2017 at 04:09:23PM -0400, Nicolas Pitre wrote: > > On Fri, 13 Oct 2017, Al Viro wrote: > > > > > OK... I wonder if it should simply define stubs for kill_mtd_super(), > > > mtd_unpoint() and kill_block_super() in !CONFIG_MTD and !CONFIG_BLOCK

Re: [PATCH v6 1/4] cramfs: direct memory access support

2017-10-13 Thread Al Viro
On Fri, Oct 13, 2017 at 04:09:23PM -0400, Nicolas Pitre wrote: > On Fri, 13 Oct 2017, Al Viro wrote: > > > OK... I wonder if it should simply define stubs for kill_mtd_super(), > > mtd_unpoint() and kill_block_super() in !CONFIG_MTD and !CONFIG_BLOCK > > cases. mount_mtd() and mount_bdev() as we

Re: [PATCH v6 1/4] cramfs: direct memory access support

2017-10-13 Thread Nicolas Pitre
e this is worth it in the end given this is not a common occurrence in the kernel either. Still, I've rearanged it slightly and fixed the null deref you spotted earlier. Latest patch below: - >8 Subject: [PATCH] cramfs: direct memory access support Small embedded systems typically ex

Re: [PATCH v6 1/4] cramfs: direct memory access support

2017-10-13 Thread Nicolas Pitre
On Fri, 13 Oct 2017, Al Viro wrote: > On Fri, Oct 13, 2017 at 01:39:13PM -0400, Nicolas Pitre wrote: > > On Fri, 13 Oct 2017, Al Viro wrote: > > > > > On Thu, Oct 12, 2017 at 02:16:10AM -0400, Nicolas Pitre wrote: > > > > > > > static void cramfs_kill_sb(struct super_block *sb) > > > > { > > >

Re: [PATCH v6 1/4] cramfs: direct memory access support

2017-10-13 Thread Al Viro
On Fri, Oct 13, 2017 at 01:39:13PM -0400, Nicolas Pitre wrote: > On Fri, 13 Oct 2017, Al Viro wrote: > > > On Thu, Oct 12, 2017 at 02:16:10AM -0400, Nicolas Pitre wrote: > > > > > static void cramfs_kill_sb(struct super_block *sb) > > > { > > > struct cramfs_sb_info *sbi = CRAMFS_SB(sb); > >

Re: [PATCH v6 1/4] cramfs: direct memory access support

2017-10-13 Thread Nicolas Pitre
On Fri, 13 Oct 2017, Al Viro wrote: > On Thu, Oct 12, 2017 at 02:16:10AM -0400, Nicolas Pitre wrote: > > > static void cramfs_kill_sb(struct super_block *sb) > > { > > struct cramfs_sb_info *sbi = CRAMFS_SB(sb); > > > > - kill_block_super(sb); > > + if (IS_ENABLED(CCONFIG_CRAMFS_MTD))

Re: [PATCH v6 1/4] cramfs: direct memory access support

2017-10-13 Thread Al Viro
On Thu, Oct 12, 2017 at 02:16:10AM -0400, Nicolas Pitre wrote: > static void cramfs_kill_sb(struct super_block *sb) > { > struct cramfs_sb_info *sbi = CRAMFS_SB(sb); > > - kill_block_super(sb); > + if (IS_ENABLED(CCONFIG_CRAMFS_MTD)) { > + if (sbi->mtd_point_size) > +

Re: [PATCH v6 3/4] cramfs: add mmap support

2017-10-13 Thread Christoph Hellwig
As said before I'm no big fan of all the debug chatter, but the rest looks fine, so: Reviewed-by: Christoph Hellwig

Re: [PATCH v6 1/4] cramfs: direct memory access support

2017-10-13 Thread Christoph Hellwig
This looks much better, thanks. I'm not a big fan of the games with IS_ENABLED and letting the compiler optimize code away, but you're the maintainer.. Reviewed-by: Christoph Hellwig

RE: [PATCH v6 1/4] cramfs: direct memory access support

2017-10-12 Thread Nicolas Pitre
em data directly from flash to the cramfs filesystem > > as well. Cramfs is particularly well suited to this feature as it is > > very simple and its RAM usage is already very low, and with this feature > > it is possible to use it with no block device support and even lower RAM &

RE: [PATCH v6 1/4] cramfs: direct memory access support

2017-10-12 Thread Chris Brandt
On Thursday, October 12, 2017, Nicolas Pitre wrote: > Small embedded systems typically execute the kernel code in place (XIP) > directly from flash to save on precious RAM usage. This adds the ability > to consume filesystem data directly from flash to the cramfs filesystem > as wel

[PATCH v6 0/4] cramfs refresh for embedded usage

2017-10-11 Thread Nicolas Pitre
This series brings a nice refresh to the cramfs filesystem, adding the following capabilities: - Direct memory access, bypassing the block and/or MTD layers entirely. - Ability to store individual data blocks uncompressed. - Ability to locate individual data blocks anywhere in the filesystem

[PATCH v6 2/4] cramfs: implement uncompressed and arbitrary data block positioning

2017-10-11 Thread Nicolas Pitre
compatible with legacy cramfs images. Signed-off-by: Nicolas Pitre Tested-by: Chris Brandt --- fs/cramfs/README | 31 ++- fs/cramfs/inode.c | 90 +- include/uapi/linux/cramfs_fs.h | 26 +++- 3 files changed, 126

[PATCH v6 1/4] cramfs: direct memory access support

2017-10-11 Thread Nicolas Pitre
Small embedded systems typically execute the kernel code in place (XIP) directly from flash to save on precious RAM usage. This adds the ability to consume filesystem data directly from flash to the cramfs filesystem as well. Cramfs is particularly well suited to this feature as it is very simple

[PATCH v6 3/4] cramfs: add mmap support

2017-10-11 Thread Nicolas Pitre
When cramfs in physical memory is used then we have the opportunity to map files directly from ROM, directly into user space, saving on RAM usage. This gives us Execute-In-Place (XIP) support. For a file to be mmap()-able, the map area has to correspond to a range of uncompressed and contiguous

[PATCH v6 4/4] cramfs: rehabilitate it

2017-10-11 Thread Nicolas Pitre
s.txt | 42 MAINTAINERS | 4 ++-- fs/cramfs/Kconfig| 9 +--- 3 files changed, 50 insertions(+), 5 deletions(-) diff --git a/Documentation/filesystems/cramfs.txt b/Documentation/filesystems/cramfs.txt index 4006298f67..8e19a53d64 100644 --- a/Doc

Re: [PATCH v5 4/5] cramfs: add mmap support

2017-10-06 Thread Nicolas Pitre
; just wouldn't be called, but that might be more confusing then helpful. Well... For one thing generic_file_vm_ops is not exported to modules so now I simply call generic_file_readonly_mmap() at the beginning and let it validate the vma flags. That allowed for some simplifications at the

RE: [PATCH v5 0/5] cramfs refresh for embedded usage

2017-10-06 Thread Nicolas Pitre
ly. This creates unneeded overhead, both in terms of code execution and TLB trashing. With a single map, the ARM code at least is smart enough to fit large MMU descriptors when possible with a single TLB for a large region. And if you're interested in XIP cramfs then you do have huge vmal

RE: [PATCH v5 0/5] cramfs refresh for embedded usage

2017-10-06 Thread Chris Brandt
On Friday, October 06, 2017, Christoph Hellwig wrote: > This is still missing a proper API for accessing the file system, > as said before specifying a physical address in the mount command > line is a an absolute non-no. > > Either work with the mtd folks to get the mtd core down to an absolute >

Re: [PATCH v5 4/5] cramfs: add mmap support

2017-10-06 Thread Christoph Hellwig
> + /* Don't map the last page if it contains some other data */ > + if (unlikely(pgoff + pages == max_pages)) { > + unsigned int partial = offset_in_page(inode->i_size); > + if (partial) { > + char *data = sbi->linear_virt_addr + offset; > +

Re: [PATCH v5 0/5] cramfs refresh for embedded usage

2017-10-05 Thread Christoph Hellwig
This is still missing a proper API for accessing the file system, as said before specifying a physical address in the mount command line is a an absolute non-no. Either work with the mtd folks to get the mtd core down to an absolute minimum suitable for you, or figure out a way to specify fs nodes

[PATCH v5 4/5] cramfs: add mmap support

2017-10-05 Thread Nicolas Pitre
efore this area is discarded. In the non-MMU case it is the get_unmapped_area method that is responsible for providing the address where the actual data can be found. No mapping is necessary of course. Signed-off-by: Nicolas Pitre Tested-by: Chris Brandt --- fs/cramf

[PATCH v5 3/5] cramfs: implement uncompressed and arbitrary data block positioning

2017-10-05 Thread Nicolas Pitre
compatible with legacy cramfs images. Signed-off-by: Nicolas Pitre Tested-by: Chris Brandt --- fs/cramfs/README | 31 ++- fs/cramfs/inode.c | 90 +- include/uapi/linux/cramfs_fs.h | 26 +++- 3 files changed, 126

[PATCH v5 2/5] cramfs: make cramfs_physmem usable as root fs

2017-10-05 Thread Nicolas Pitre
prepare_namespace(void) ssleep(root_delay); } + if (IS_ENABLED(CONFIG_CRAMFS_PHYSMEM) && root_fs_names && + !strcmp(root_fs_names, "cramfs_physmem")) { + int err = do_mount_root

[PATCH v5 0/5] cramfs refresh for embedded usage

2017-10-05 Thread Nicolas Pitre
This series brings a nice refresh to the cramfs filesystem, adding the following capabilities: - Direct memory access, bypassing the block and/or MTD layers entirely. - Ability to store individual data blocks uncompressed. - Ability to locate individual data blocks anywhere in the filesystem

[PATCH v5 1/5] cramfs: direct memory access support

2017-10-05 Thread Nicolas Pitre
Small embedded systems typically execute the kernel code in place (XIP) directly from flash to save on precious RAM usage. This adds the ability to consume filesystem data directly from flash to the cramfs filesystem as well. Cramfs is particularly well suited to this feature as it is very simple

[PATCH v5 5/5] cramfs: rehabilitate it

2017-10-05 Thread Nicolas Pitre
s.txt | 42 MAINTAINERS | 4 ++-- fs/cramfs/Kconfig| 9 +--- 3 files changed, 50 insertions(+), 5 deletions(-) diff --git a/Documentation/filesystems/cramfs.txt b/Documentation/filesystems/cramfs.txt index 4006298f67..8875d306bc 100644 --- a/Doc

RE: [PATCH v4 4/5] cramfs: add mmap support

2017-10-05 Thread Chris Brandt
On Thursday, October 05, 2017, Nicolas Pitre wrote: > Do you have the same amount of free memory once booted in both cases? Yes, almost exactly the same, so obvious it must be working the same for both cases. That's enough evidence for me. Thanks. Chris

RE: [PATCH v4 4/5] cramfs: add mmap support

2017-10-05 Thread Nicolas Pitre
On Thu, 5 Oct 2017, Chris Brandt wrote: > On Wednesday, October 04, 2017, Nicolas Pitre wrote: > > Anyway, here's a replacement for patch 4/5 below: > > > > ----- >8 > > Subject: cramfs: add mmap support > > > > When cramfs_physmem is used then we

RE: [PATCH v4 4/5] cramfs: add mmap support

2017-10-05 Thread Chris Brandt
e actual physical address in vma->vm_pgoff. > With VM_MIXEDMAP things are no longer visible. Any opinion for the best > way to overcome this? > > Anyway, here's a replacement for patch 4/5 below: > > - >8 > Subject: cramfs: add mmap support > > When cramfs

Re: [PATCH v4 4/5] cramfs: add mmap support

2017-10-05 Thread Nicolas Pitre
On Thu, 5 Oct 2017, Christoph Hellwig wrote: > On Wed, Oct 04, 2017 at 04:47:52PM -0400, Nicolas Pitre wrote: > > The only downside so far is the lack of visibility from user space to > > confirm it actually works as intended. With the vma splitting approach > > you clearly see what gets directl

Re: [PATCH v4 4/5] cramfs: add mmap support

2017-10-05 Thread Christoph Hellwig
ckptrs[0] & ~CRAMFS_BLK_FLAGS; > + i = 0; > + do { > + u32 expect = blockaddr + i * (PAGE_SIZE >> 2); There are a lot of magic numbers in here. It seems like that's standard for cramfs, but if you really plan to bring it back to

Re: [PATCH v4 4/5] cramfs: add mmap support

2017-10-04 Thread Nicolas Pitre
the best way to overcome this? Anyway, here's a replacement for patch 4/5 below: ----- >8 Subject: cramfs: add mmap support When cramfs_physmem is used then we have the opportunity to map files directly from ROM, directly into user space, saving on RAM usage. This gives us Execute-In-Pl

Re: [PATCH v4 4/5] cramfs: add mmap support

2017-10-04 Thread Christoph Hellwig
On Tue, Oct 03, 2017 at 11:40:28AM -0400, Nicolas Pitre wrote: > I provided that explanation several times by now in my cover letter. And > separately even to you directly at least once. What else should I do? You should do the right things instead of stating irrelevant things in your cover lett

Re: [PATCH v4 4/5] cramfs: add mmap support

2017-10-03 Thread Nicolas Pitre
On Tue, 3 Oct 2017, Christoph Hellwig wrote: > On Tue, Oct 03, 2017 at 11:30:50AM -0400, Nicolas Pitre wrote: > > Unless you have a better scheme altogether to suggest of course, given > > the existing constraints. > > I still can't understand why this convoluted fault path that finds > vma, at

Re: [PATCH v4 4/5] cramfs: add mmap support

2017-10-03 Thread Christoph Hellwig
On Tue, Oct 03, 2017 at 11:30:50AM -0400, Nicolas Pitre wrote: > Unless you have a better scheme altogether to suggest of course, given > the existing constraints. I still can't understand why this convoluted fault path that finds vma, attempts with all kinds of races and then tries to update th

Re: [PATCH v4 4/5] cramfs: add mmap support

2017-10-03 Thread Nicolas Pitre
On Tue, 3 Oct 2017, Christoph Hellwig wrote: > On Mon, Oct 02, 2017 at 07:33:29PM -0400, Nicolas Pitre wrote: > > On Tue, 3 Oct 2017, Richard Weinberger wrote: > > > > > On Mon, Oct 2, 2017 at 12:29 AM, Nicolas Pitre > > > wrote: > > > > On Sun, 1 Oct 2017, Christoph Hellwig wrote: > > > > > >

Re: [PATCH v4 1/5] cramfs: direct memory access support

2017-10-03 Thread Nicolas Pitre
On Tue, 3 Oct 2017, Christoph Hellwig wrote: > On Sun, Oct 01, 2017 at 06:27:11PM -0400, Nicolas Pitre wrote: > > If you prefer, the physical address could be specified with a Kconfig > > symbol just like the kernel link address. Personally I think it is best > > to keep it along with the other

RE: [PATCH v4 1/5] cramfs: direct memory access support

2017-10-03 Thread Chris Brandt
must be specified when using a memory accessible cramfs image, and > >> the physaddr argument must provide the actual filesystem image's > physical > >> memory location. > > > > Sorry, but this still is a complete no-go. A physical address is not a > > pr

Re: [PATCH v4 1/5] cramfs: direct memory access support

2017-10-03 Thread Christoph Hellwig
On Sun, Oct 01, 2017 at 06:27:11PM -0400, Nicolas Pitre wrote: > If you prefer, the physical address could be specified with a Kconfig > symbol just like the kernel link address. Personally I think it is best > to keep it along with the other root mount args. But going all the way > with a dynam

Re: [PATCH v4 4/5] cramfs: add mmap support

2017-10-03 Thread Christoph Hellwig
On Mon, Oct 02, 2017 at 07:33:29PM -0400, Nicolas Pitre wrote: > On Tue, 3 Oct 2017, Richard Weinberger wrote: > > > On Mon, Oct 2, 2017 at 12:29 AM, Nicolas Pitre > > wrote: > > > On Sun, 1 Oct 2017, Christoph Hellwig wrote: > > > > > >> up_read(&mm->mmap_sem) in the fault path is a still a com

Re: [PATCH v4 1/5] cramfs: direct memory access support

2017-10-03 Thread Rob Herring
On Sun, Oct 1, 2017 at 3:29 AM, Christoph Hellwig wrote: > On Wed, Sep 27, 2017 at 07:32:20PM -0400, Nicolas Pitre wrote: >> To distinguish between both access types, the cramfs_physmem filesystem >> type must be specified when using a memory accessible cramfs image, and >>

Re: [PATCH v4 4/5] cramfs: add mmap support

2017-10-02 Thread Nicolas Pitre
On Tue, 3 Oct 2017, Richard Weinberger wrote: > On Mon, Oct 2, 2017 at 12:29 AM, Nicolas Pitre > wrote: > > On Sun, 1 Oct 2017, Christoph Hellwig wrote: > > > >> up_read(&mm->mmap_sem) in the fault path is a still a complete > >> no-go, > >> > >> NAK > > > > Care to elaborate? > > > > What about

  1   2   3   4   >