Linux-Fsdevel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2] fs/dax: include <asm/page.h> to fix build error on ARC
@ 2021-01-01  4:29 Randy Dunlap
  2021-01-04 16:12 ` Ira Weiny
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Randy Dunlap @ 2021-01-01  4:29 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, kernel test robot, Vineet Gupta, linux-snps-arc,
	Dan Williams, Vineet Gupta, Andrew Morton, Matthew Wilcox,
	Jan Kara, linux-fsdevel, linux-nvdimm

fs/dax.c uses copy_user_page() but ARC does not provide that interface,
resulting in a build error.

Provide copy_user_page() in <asm/page.h> (beside copy_page()) and
add <asm/page.h> to fs/dax.c to fix the build error.

../fs/dax.c: In function 'copy_cow_page_dax':
../fs/dax.c:702:2: error: implicit declaration of function 'copy_user_page'; did you mean 'copy_to_user_page'? [-Werror=implicit-function-declaration]

Fixes: cccbce671582 ("filesystem-dax: convert to dax_direct_access()")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: linux-snps-arc@lists.infradead.org
Cc: Dan Williams <dan.j.williams@intel.com>
Acked-by: Vineet Gupta <vgupts@synopsys.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Jan Kara <jack@suse.cz>
Cc: linux-fsdevel@vger.kernel.org
Cc: linux-nvdimm@lists.01.org
---
v2: rebase, add more Cc:

 arch/arc/include/asm/page.h |    1 +
 fs/dax.c                    |    1 +
 2 files changed, 2 insertions(+)

--- lnx-511-rc1.orig/fs/dax.c
+++ lnx-511-rc1/fs/dax.c
@@ -25,6 +25,7 @@
 #include <linux/sizes.h>
 #include <linux/mmu_notifier.h>
 #include <linux/iomap.h>
+#include <asm/page.h>
 #include <asm/pgalloc.h>
 
 #define CREATE_TRACE_POINTS
--- lnx-511-rc1.orig/arch/arc/include/asm/page.h
+++ lnx-511-rc1/arch/arc/include/asm/page.h
@@ -10,6 +10,7 @@
 #ifndef __ASSEMBLY__
 
 #define clear_page(paddr)		memset((paddr), 0, PAGE_SIZE)
+#define copy_user_page(to, from, vaddr, pg)	copy_page(to, from)
 #define copy_page(to, from)		memcpy((to), (from), PAGE_SIZE)
 
 struct vm_area_struct;

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

* Re: [PATCH v2] fs/dax: include <asm/page.h> to fix build error on ARC
  2021-01-01  4:29 [PATCH v2] fs/dax: include <asm/page.h> to fix build error on ARC Randy Dunlap
@ 2021-01-04 16:12 ` Ira Weiny
  2021-01-04 20:13 ` Dan Williams
  2021-01-05  4:17 ` Al Viro
  2 siblings, 0 replies; 7+ messages in thread
From: Ira Weiny @ 2021-01-04 16:12 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-kernel, kernel test robot, Vineet Gupta, linux-snps-arc,
	Vineet Gupta, Andrew Morton, Matthew Wilcox, Jan Kara,
	linux-fsdevel, linux-nvdimm

On Thu, Dec 31, 2020 at 08:29:14PM -0800, Randy Dunlap wrote:
> fs/dax.c uses copy_user_page() but ARC does not provide that interface,
> resulting in a build error.
> 
> Provide copy_user_page() in <asm/page.h> (beside copy_page()) and
> add <asm/page.h> to fs/dax.c to fix the build error.
> 
> ../fs/dax.c: In function 'copy_cow_page_dax':
> ../fs/dax.c:702:2: error: implicit declaration of function 'copy_user_page'; did you mean 'copy_to_user_page'? [-Werror=implicit-function-declaration]
> 
> Fixes: cccbce671582 ("filesystem-dax: convert to dax_direct_access()")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>

Looks reasonable
Reviewed-by: Ira Weiny <ira.weiny@intel.com>

> Cc: Vineet Gupta <vgupta@synopsys.com>
> Cc: linux-snps-arc@lists.infradead.org
> Cc: Dan Williams <dan.j.williams@intel.com>
> Acked-by: Vineet Gupta <vgupts@synopsys.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Matthew Wilcox <willy@infradead.org>
> Cc: Jan Kara <jack@suse.cz>
> Cc: linux-fsdevel@vger.kernel.org
> Cc: linux-nvdimm@lists.01.org
> ---
> v2: rebase, add more Cc:
> 
>  arch/arc/include/asm/page.h |    1 +
>  fs/dax.c                    |    1 +
>  2 files changed, 2 insertions(+)
> 
> --- lnx-511-rc1.orig/fs/dax.c
> +++ lnx-511-rc1/fs/dax.c
> @@ -25,6 +25,7 @@
>  #include <linux/sizes.h>
>  #include <linux/mmu_notifier.h>
>  #include <linux/iomap.h>
> +#include <asm/page.h>
>  #include <asm/pgalloc.h>
>  
>  #define CREATE_TRACE_POINTS
> --- lnx-511-rc1.orig/arch/arc/include/asm/page.h
> +++ lnx-511-rc1/arch/arc/include/asm/page.h
> @@ -10,6 +10,7 @@
>  #ifndef __ASSEMBLY__
>  
>  #define clear_page(paddr)		memset((paddr), 0, PAGE_SIZE)
> +#define copy_user_page(to, from, vaddr, pg)	copy_page(to, from)
>  #define copy_page(to, from)		memcpy((to), (from), PAGE_SIZE)
>  
>  struct vm_area_struct;
> _______________________________________________
> Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
> To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

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

* Re: [PATCH v2] fs/dax: include <asm/page.h> to fix build error on ARC
  2021-01-01  4:29 [PATCH v2] fs/dax: include <asm/page.h> to fix build error on ARC Randy Dunlap
  2021-01-04 16:12 ` Ira Weiny
@ 2021-01-04 20:13 ` Dan Williams
  2021-01-04 20:16   ` Matthew Wilcox
  2021-01-05  3:41   ` Randy Dunlap
  2021-01-05  4:17 ` Al Viro
  2 siblings, 2 replies; 7+ messages in thread
From: Dan Williams @ 2021-01-04 20:13 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Linux Kernel Mailing List, kernel test robot, Vineet Gupta,
	linux-snps-arc, Vineet Gupta, Andrew Morton, Matthew Wilcox,
	Jan Kara, linux-fsdevel, linux-nvdimm

On Thu, Dec 31, 2020 at 8:29 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>
> fs/dax.c uses copy_user_page() but ARC does not provide that interface,
> resulting in a build error.
>
> Provide copy_user_page() in <asm/page.h> (beside copy_page()) and
> add <asm/page.h> to fs/dax.c to fix the build error.
>
> ../fs/dax.c: In function 'copy_cow_page_dax':
> ../fs/dax.c:702:2: error: implicit declaration of function 'copy_user_page'; did you mean 'copy_to_user_page'? [-Werror=implicit-function-declaration]
>
> Fixes: cccbce671582 ("filesystem-dax: convert to dax_direct_access()")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Vineet Gupta <vgupta@synopsys.com>
> Cc: linux-snps-arc@lists.infradead.org
> Cc: Dan Williams <dan.j.williams@intel.com>
> Acked-by: Vineet Gupta <vgupts@synopsys.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Matthew Wilcox <willy@infradead.org>
> Cc: Jan Kara <jack@suse.cz>
> Cc: linux-fsdevel@vger.kernel.org
> Cc: linux-nvdimm@lists.01.org
> ---
> v2: rebase, add more Cc:
>
>  arch/arc/include/asm/page.h |    1 +
>  fs/dax.c                    |    1 +
>  2 files changed, 2 insertions(+)
>
> --- lnx-511-rc1.orig/fs/dax.c
> +++ lnx-511-rc1/fs/dax.c
> @@ -25,6 +25,7 @@
>  #include <linux/sizes.h>
>  #include <linux/mmu_notifier.h>
>  #include <linux/iomap.h>
> +#include <asm/page.h>

I would expect this to come from one of the linux/ includes like
linux/mm.h. asm/ headers are implementation linux/ headers are api.

Once you drop that then the subject of this patch can just be "arc:
add a copy_user_page() implementation", and handled by the arc
maintainer (or I can take it with Vineet's ack).

>  #include <asm/pgalloc.h>

Yes, this one should have a linux/ api header to front it, but that's
a cleanup for another day.

>
>  #define CREATE_TRACE_POINTS
> --- lnx-511-rc1.orig/arch/arc/include/asm/page.h
> +++ lnx-511-rc1/arch/arc/include/asm/page.h
> @@ -10,6 +10,7 @@
>  #ifndef __ASSEMBLY__
>
>  #define clear_page(paddr)              memset((paddr), 0, PAGE_SIZE)
> +#define copy_user_page(to, from, vaddr, pg)    copy_page(to, from)
>  #define copy_page(to, from)            memcpy((to), (from), PAGE_SIZE)
>
>  struct vm_area_struct;

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

* Re: [PATCH v2] fs/dax: include <asm/page.h> to fix build error on ARC
  2021-01-04 20:13 ` Dan Williams
@ 2021-01-04 20:16   ` Matthew Wilcox
  2021-01-05  3:41   ` Randy Dunlap
  1 sibling, 0 replies; 7+ messages in thread
From: Matthew Wilcox @ 2021-01-04 20:16 UTC (permalink / raw)
  To: Dan Williams
  Cc: Randy Dunlap, Linux Kernel Mailing List, kernel test robot,
	Vineet Gupta, linux-snps-arc, Vineet Gupta, Andrew Morton,
	Jan Kara, linux-fsdevel, linux-nvdimm

On Mon, Jan 04, 2021 at 12:13:02PM -0800, Dan Williams wrote:
> On Thu, Dec 31, 2020 at 8:29 PM Randy Dunlap <rdunlap@infradead.org> wrote:
> > +++ lnx-511-rc1/fs/dax.c
> > @@ -25,6 +25,7 @@
> >  #include <linux/sizes.h>
> >  #include <linux/mmu_notifier.h>
> >  #include <linux/iomap.h>
> > +#include <asm/page.h>
> 
> I would expect this to come from one of the linux/ includes like
> linux/mm.h. asm/ headers are implementation linux/ headers are api.

It does indeed come from linux/mm.h already.  And a number of
other random places, including linux/serial.h.  Our headers are a mess,
but they shouldn't be made worse by adding _this_ include.  So I
second Dan's objection here.

> Once you drop that then the subject of this patch can just be "arc:
> add a copy_user_page() implementation", and handled by the arc
> maintainer (or I can take it with Vineet's ack).
> 
> >  #include <asm/pgalloc.h>
> 
> Yes, this one should have a linux/ api header to front it, but that's
> a cleanup for another day.

Definitely more involved.


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

* Re: [PATCH v2] fs/dax: include <asm/page.h> to fix build error on ARC
  2021-01-04 20:13 ` Dan Williams
  2021-01-04 20:16   ` Matthew Wilcox
@ 2021-01-05  3:41   ` Randy Dunlap
  2021-01-05  3:50     ` Dan Williams
  1 sibling, 1 reply; 7+ messages in thread
From: Randy Dunlap @ 2021-01-05  3:41 UTC (permalink / raw)
  To: Dan Williams
  Cc: Linux Kernel Mailing List, kernel test robot, Vineet Gupta,
	linux-snps-arc, Vineet Gupta, Andrew Morton, Matthew Wilcox,
	Jan Kara, linux-fsdevel, linux-nvdimm

On 1/4/21 12:13 PM, Dan Williams wrote:
> On Thu, Dec 31, 2020 at 8:29 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>>
>> fs/dax.c uses copy_user_page() but ARC does not provide that interface,
>> resulting in a build error.
>>
>> Provide copy_user_page() in <asm/page.h> (beside copy_page()) and
>> add <asm/page.h> to fs/dax.c to fix the build error.
>>
>> ../fs/dax.c: In function 'copy_cow_page_dax':
>> ../fs/dax.c:702:2: error: implicit declaration of function 'copy_user_page'; did you mean 'copy_to_user_page'? [-Werror=implicit-function-declaration]
>>
>> Fixes: cccbce671582 ("filesystem-dax: convert to dax_direct_access()")
>> Reported-by: kernel test robot <lkp@intel.com>
>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>> Cc: Vineet Gupta <vgupta@synopsys.com>
>> Cc: linux-snps-arc@lists.infradead.org
>> Cc: Dan Williams <dan.j.williams@intel.com>
>> Acked-by: Vineet Gupta <vgupts@synopsys.com>
>> Cc: Andrew Morton <akpm@linux-foundation.org>
>> Cc: Matthew Wilcox <willy@infradead.org>
>> Cc: Jan Kara <jack@suse.cz>
>> Cc: linux-fsdevel@vger.kernel.org
>> Cc: linux-nvdimm@lists.01.org
>> ---
>> v2: rebase, add more Cc:
>>
>>  arch/arc/include/asm/page.h |    1 +
>>  fs/dax.c                    |    1 +
>>  2 files changed, 2 insertions(+)
>>
>> --- lnx-511-rc1.orig/fs/dax.c
>> +++ lnx-511-rc1/fs/dax.c
>> @@ -25,6 +25,7 @@
>>  #include <linux/sizes.h>
>>  #include <linux/mmu_notifier.h>
>>  #include <linux/iomap.h>
>> +#include <asm/page.h>
> 
> I would expect this to come from one of the linux/ includes like
> linux/mm.h. asm/ headers are implementation linux/ headers are api.
> 
> Once you drop that then the subject of this patch can just be "arc:
> add a copy_user_page() implementation", and handled by the arc
> maintainer (or I can take it with Vineet's ack).

Got it. Thanks.
Vineet is copied. I expect that he will take the v3 patch.

>>  #include <asm/pgalloc.h>
> 
> Yes, this one should have a linux/ api header to front it, but that's
> a cleanup for another day.

That line is only part of the contextual diff in this patch.
I guess you are just commenting in general, along with your earlier
paragraph.

>>
>>  #define CREATE_TRACE_POINTS
>> --- lnx-511-rc1.orig/arch/arc/include/asm/page.h
>> +++ lnx-511-rc1/arch/arc/include/asm/page.h
>> @@ -10,6 +10,7 @@
>>  #ifndef __ASSEMBLY__
>>
>>  #define clear_page(paddr)              memset((paddr), 0, PAGE_SIZE)
>> +#define copy_user_page(to, from, vaddr, pg)    copy_page(to, from)
>>  #define copy_page(to, from)            memcpy((to), (from), PAGE_SIZE)
>>
>>  struct vm_area_struct;


-- 
~Randy


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

* Re: [PATCH v2] fs/dax: include <asm/page.h> to fix build error on ARC
  2021-01-05  3:41   ` Randy Dunlap
@ 2021-01-05  3:50     ` Dan Williams
  0 siblings, 0 replies; 7+ messages in thread
From: Dan Williams @ 2021-01-05  3:50 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Linux Kernel Mailing List, kernel test robot, Vineet Gupta,
	linux-snps-arc, Vineet Gupta, Andrew Morton, Matthew Wilcox,
	Jan Kara, linux-fsdevel, linux-nvdimm

On Mon, Jan 4, 2021 at 7:47 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>
> On 1/4/21 12:13 PM, Dan Williams wrote:
> > On Thu, Dec 31, 2020 at 8:29 PM Randy Dunlap <rdunlap@infradead.org> wrote:
> >>
> >> fs/dax.c uses copy_user_page() but ARC does not provide that interface,
> >> resulting in a build error.
> >>
> >> Provide copy_user_page() in <asm/page.h> (beside copy_page()) and
> >> add <asm/page.h> to fs/dax.c to fix the build error.
> >>
> >> ../fs/dax.c: In function 'copy_cow_page_dax':
> >> ../fs/dax.c:702:2: error: implicit declaration of function 'copy_user_page'; did you mean 'copy_to_user_page'? [-Werror=implicit-function-declaration]
> >>
> >> Fixes: cccbce671582 ("filesystem-dax: convert to dax_direct_access()")
> >> Reported-by: kernel test robot <lkp@intel.com>
> >> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> >> Cc: Vineet Gupta <vgupta@synopsys.com>
> >> Cc: linux-snps-arc@lists.infradead.org
> >> Cc: Dan Williams <dan.j.williams@intel.com>
> >> Acked-by: Vineet Gupta <vgupts@synopsys.com>
> >> Cc: Andrew Morton <akpm@linux-foundation.org>
> >> Cc: Matthew Wilcox <willy@infradead.org>
> >> Cc: Jan Kara <jack@suse.cz>
> >> Cc: linux-fsdevel@vger.kernel.org
> >> Cc: linux-nvdimm@lists.01.org
> >> ---
> >> v2: rebase, add more Cc:
> >>
> >>  arch/arc/include/asm/page.h |    1 +
> >>  fs/dax.c                    |    1 +
> >>  2 files changed, 2 insertions(+)
> >>
> >> --- lnx-511-rc1.orig/fs/dax.c
> >> +++ lnx-511-rc1/fs/dax.c
> >> @@ -25,6 +25,7 @@
> >>  #include <linux/sizes.h>
> >>  #include <linux/mmu_notifier.h>
> >>  #include <linux/iomap.h>
> >> +#include <asm/page.h>
> >
> > I would expect this to come from one of the linux/ includes like
> > linux/mm.h. asm/ headers are implementation linux/ headers are api.
> >
> > Once you drop that then the subject of this patch can just be "arc:
> > add a copy_user_page() implementation", and handled by the arc
> > maintainer (or I can take it with Vineet's ack).
>
> Got it. Thanks.
> Vineet is copied. I expect that he will take the v3 patch.
>
> >>  #include <asm/pgalloc.h>
> >
> > Yes, this one should have a linux/ api header to front it, but that's
> > a cleanup for another day.
>
> That line is only part of the contextual diff in this patch.
> I guess you are just commenting in general, along with your earlier
> paragraph.

Yes, I was prefetching a "...hey, but, there's an asm/ include right
below this one?"

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

* Re: [PATCH v2] fs/dax: include <asm/page.h> to fix build error on ARC
  2021-01-01  4:29 [PATCH v2] fs/dax: include <asm/page.h> to fix build error on ARC Randy Dunlap
  2021-01-04 16:12 ` Ira Weiny
  2021-01-04 20:13 ` Dan Williams
@ 2021-01-05  4:17 ` Al Viro
  2 siblings, 0 replies; 7+ messages in thread
From: Al Viro @ 2021-01-05  4:17 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-kernel, kernel test robot, Vineet Gupta, linux-snps-arc,
	Dan Williams, Vineet Gupta, Andrew Morton, Matthew Wilcox,
	Jan Kara, linux-fsdevel, linux-nvdimm

On Thu, Dec 31, 2020 at 08:29:14PM -0800, Randy Dunlap wrote:
> fs/dax.c uses copy_user_page() but ARC does not provide that interface,
> resulting in a build error.
> 
> Provide copy_user_page() in <asm/page.h> (beside copy_page()) and
> add <asm/page.h> to fs/dax.c to fix the build error.
> 
> ../fs/dax.c: In function 'copy_cow_page_dax':
> ../fs/dax.c:702:2: error: implicit declaration of function 'copy_user_page'; did you mean 'copy_to_user_page'? [-Werror=implicit-function-declaration]

Could somebody explain what the force-cast is doing in there?
I mean, the call is
        copy_user_page(vto, (void __force *)kaddr, vaddr, to);
kaddr is a local variable there, declared as void *; AFAICS, that
had been pure cargo-cult since
commit 7a9eb20666317794d0279843fbd091af93907780
Author: Dan Williams <dan.j.williams@intel.com>
Date:   Fri Jun 3 18:06:47 2016 -0700

    pmem: kill __pmem address space

I mean, it's been more than 4 years, time to bury that body...

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

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-01  4:29 [PATCH v2] fs/dax: include <asm/page.h> to fix build error on ARC Randy Dunlap
2021-01-04 16:12 ` Ira Weiny
2021-01-04 20:13 ` Dan Williams
2021-01-04 20:16   ` Matthew Wilcox
2021-01-05  3:41   ` Randy Dunlap
2021-01-05  3:50     ` Dan Williams
2021-01-05  4:17 ` Al Viro

Linux-Fsdevel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-fsdevel/0 linux-fsdevel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-fsdevel linux-fsdevel/ https://lore.kernel.org/linux-fsdevel \
		linux-fsdevel@vger.kernel.org
	public-inbox-index linux-fsdevel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-fsdevel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git