linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] nfs: fsinfo: fix build when CONFIG_NFS_V4 is not enabled
@ 2020-05-15 17:27 Randy Dunlap
  2020-05-15 17:33 ` Trond Myklebust
  2020-05-16 10:53 ` David Howells
  0 siblings, 2 replies; 4+ messages in thread
From: Randy Dunlap @ 2020-05-15 17:27 UTC (permalink / raw)
  To: open list:NFS, SUNRPC, AND...,
	Linux FS Devel, Al Viro, David Howells, Trond Myklebust,
	Anna Schumaker, LKML

From: Randy Dunlap <rdunlap@infradead.org>

Fix multiple build errors when CONFIG_NFS_V4 is not enabled.

../fs/nfs/fsinfo.c: In function 'nfs_fsinfo_get_supports':
../fs/nfs/fsinfo.c:153:12: error: 'const struct nfs_server' has no member named 'attr_bitmask'
  if (server->attr_bitmask[0] & FATTR4_WORD0_SIZE)
            ^~
../fs/nfs/fsinfo.c:155:12: error: 'const struct nfs_server' has no member named 'attr_bitmask'
  if (server->attr_bitmask[1] & FATTR4_WORD1_NUMLINKS)
            ^~
../fs/nfs/fsinfo.c:158:12: error: 'const struct nfs_server' has no member named 'attr_bitmask'
  if (server->attr_bitmask[0] & FATTR4_WORD0_ARCHIVE)
            ^~
../fs/nfs/fsinfo.c:160:12: error: 'const struct nfs_server' has no member named 'attr_bitmask'
  if (server->attr_bitmask[0] & FATTR4_WORD0_HIDDEN)
            ^~
../fs/nfs/fsinfo.c:162:12: error: 'const struct nfs_server' has no member named 'attr_bitmask'
  if (server->attr_bitmask[1] & FATTR4_WORD1_SYSTEM)
            ^~
../fs/nfs/fsinfo.c: In function 'nfs_fsinfo_get_features':
../fs/nfs/fsinfo.c:205:12: error: 'const struct nfs_server' has no member named 'attr_bitmask'
  if (server->attr_bitmask[0] & FATTR4_WORD0_CASE_INSENSITIVE)
            ^~
../fs/nfs/fsinfo.c:207:13: error: 'const struct nfs_server' has no member named 'attr_bitmask'
  if ((server->attr_bitmask[0] & FATTR4_WORD0_ARCHIVE) ||
             ^~
../fs/nfs/fsinfo.c:208:13: error: 'const struct nfs_server' has no member named 'attr_bitmask'
      (server->attr_bitmask[0] & FATTR4_WORD0_HIDDEN) ||
             ^~
../fs/nfs/fsinfo.c:209:13: error: 'const struct nfs_server' has no member named 'attr_bitmask'
      (server->attr_bitmask[1] & FATTR4_WORD1_SYSTEM))
             ^~


Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: linux-nfs@vger.kernel.org
Cc: Trond Myklebust <trond.myklebust@hammerspace.com>
Cc: Anna Schumaker <anna.schumaker@netapp.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Cc: David Howells <dhowells@redhat.com>
---
 fs/nfs/fsinfo.c |    5 +++++
 1 file changed, 5 insertions(+)

--- linux-next-20200515.orig/fs/nfs/fsinfo.c
+++ linux-next-20200515/fs/nfs/fsinfo.c
@@ -5,6 +5,7 @@
  * Written by David Howells (dhowells@redhat.com)
  */
 
+#include <linux/kconfig.h>
 #include <linux/nfs_fs.h>
 #include <linux/windows.h>
 #include "internal.h"
@@ -150,6 +151,7 @@ static int nfs_fsinfo_get_supports(struc
 		sup->stx_mask |= STATX_CTIME;
 	if (server->caps & NFS_CAP_MTIME)
 		sup->stx_mask |= STATX_MTIME;
+#if IS_ENABLED(CONFIG_NFS_V4)
 	if (server->attr_bitmask[0] & FATTR4_WORD0_SIZE)
 		sup->stx_mask |= STATX_SIZE;
 	if (server->attr_bitmask[1] & FATTR4_WORD1_NUMLINKS)
@@ -161,6 +163,7 @@ static int nfs_fsinfo_get_supports(struc
 		sup->win_file_attrs |= ATTR_HIDDEN;
 	if (server->attr_bitmask[1] & FATTR4_WORD1_SYSTEM)
 		sup->win_file_attrs |= ATTR_SYSTEM;
+#endif
 
 	sup->stx_attributes = STATX_ATTR_AUTOMOUNT;
 	return sizeof(*sup);
@@ -202,12 +205,14 @@ static int nfs_fsinfo_get_features(struc
 	if (server->caps & NFS_CAP_MTIME)
 		fsinfo_set_feature(ft, FSINFO_FEAT_HAS_MTIME);
 
+#if IS_ENABLED(CONFIG_NFS_V4)
 	if (server->attr_bitmask[0] & FATTR4_WORD0_CASE_INSENSITIVE)
 		fsinfo_set_feature(ft, FSINFO_FEAT_NAME_CASE_INDEP);
 	if ((server->attr_bitmask[0] & FATTR4_WORD0_ARCHIVE) ||
 	    (server->attr_bitmask[0] & FATTR4_WORD0_HIDDEN) ||
 	    (server->attr_bitmask[1] & FATTR4_WORD1_SYSTEM))
 		fsinfo_set_feature(ft, FSINFO_FEAT_WINDOWS_ATTRS);
+#endif
 
 	return sizeof(*ft);
 }


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

* Re: [PATCH -next] nfs: fsinfo: fix build when CONFIG_NFS_V4 is not enabled
  2020-05-15 17:27 [PATCH -next] nfs: fsinfo: fix build when CONFIG_NFS_V4 is not enabled Randy Dunlap
@ 2020-05-15 17:33 ` Trond Myklebust
  2020-05-15 17:36   ` Randy Dunlap
  2020-05-16 10:53 ` David Howells
  1 sibling, 1 reply; 4+ messages in thread
From: Trond Myklebust @ 2020-05-15 17:33 UTC (permalink / raw)
  To: linux-kernel, linux-nfs, linux-fsdevel, rdunlap, viro, dhowells,
	anna.schumaker

On Fri, 2020-05-15 at 10:27 -0700, Randy Dunlap wrote:
> From: Randy Dunlap <rdunlap@infradead.org>
> 
> Fix multiple build errors when CONFIG_NFS_V4 is not enabled.
> 
> ../fs/nfs/fsinfo.c: In function 'nfs_fsinfo_get_supports':
> ../fs/nfs/fsinfo.c:153:12: error: 'const struct nfs_server' has no
> member named 'attr_bitmask'
>   if (server->attr_bitmask[0] & FATTR4_WORD0_SIZE)
>             ^~
> ../fs/nfs/fsinfo.c:155:12: error: 'const struct nfs_server' has no
> member named 'attr_bitmask'
>   if (server->attr_bitmask[1] & FATTR4_WORD1_NUMLINKS)
>             ^~
> ../fs/nfs/fsinfo.c:158:12: error: 'const struct nfs_server' has no
> member named 'attr_bitmask'
>   if (server->attr_bitmask[0] & FATTR4_WORD0_ARCHIVE)
>             ^~
> ../fs/nfs/fsinfo.c:160:12: error: 'const struct nfs_server' has no
> member named 'attr_bitmask'
>   if (server->attr_bitmask[0] & FATTR4_WORD0_HIDDEN)
>             ^~
> ../fs/nfs/fsinfo.c:162:12: error: 'const struct nfs_server' has no
> member named 'attr_bitmask'
>   if (server->attr_bitmask[1] & FATTR4_WORD1_SYSTEM)
>             ^~
> ../fs/nfs/fsinfo.c: In function 'nfs_fsinfo_get_features':
> ../fs/nfs/fsinfo.c:205:12: error: 'const struct nfs_server' has no
> member named 'attr_bitmask'
>   if (server->attr_bitmask[0] & FATTR4_WORD0_CASE_INSENSITIVE)
>             ^~
> ../fs/nfs/fsinfo.c:207:13: error: 'const struct nfs_server' has no
> member named 'attr_bitmask'
>   if ((server->attr_bitmask[0] & FATTR4_WORD0_ARCHIVE) ||
>              ^~
> ../fs/nfs/fsinfo.c:208:13: error: 'const struct nfs_server' has no
> member named 'attr_bitmask'
>       (server->attr_bitmask[0] & FATTR4_WORD0_HIDDEN) ||
>              ^~
> ../fs/nfs/fsinfo.c:209:13: error: 'const struct nfs_server' has no
> member named 'attr_bitmask'
>       (server->attr_bitmask[1] & FATTR4_WORD1_SYSTEM))
>              ^~
> 
> 
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: linux-nfs@vger.kernel.org
> Cc: Trond Myklebust <trond.myklebust@hammerspace.com>
> Cc: Anna Schumaker <anna.schumaker@netapp.com>
> Cc: Alexander Viro <viro@zeniv.linux.org.uk>
> Cc: linux-fsdevel@vger.kernel.org
> Cc: David Howells <dhowells@redhat.com>
> ---
>  fs/nfs/fsinfo.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> --- linux-next-20200515.orig/fs/nfs/fsinfo.c
> +++ linux-next-20200515/fs/nfs/fsinfo.c
> @@ -5,6 +5,7 @@
>   * Written by David Howells (dhowells@redhat.com)
>   */
>  
> +#include <linux/kconfig.h>
>  #include <linux/nfs_fs.h>
>  #include <linux/windows.h>
>  #include "internal.h"
> @@ -150,6 +151,7 @@ static int nfs_fsinfo_get_supports(struc
>  		sup->stx_mask |= STATX_CTIME;
>  	if (server->caps & NFS_CAP_MTIME)
>  		sup->stx_mask |= STATX_MTIME;
> +#if IS_ENABLED(CONFIG_NFS_V4)
>  	if (server->attr_bitmask[0] & FATTR4_WORD0_SIZE)
>  		sup->stx_mask |= STATX_SIZE;
>  	if (server->attr_bitmask[1] & FATTR4_WORD1_NUMLINKS)
> @@ -161,6 +163,7 @@ static int nfs_fsinfo_get_supports(struc
>  		sup->win_file_attrs |= ATTR_HIDDEN;
>  	if (server->attr_bitmask[1] & FATTR4_WORD1_SYSTEM)
>  		sup->win_file_attrs |= ATTR_SYSTEM;
> +#endif
>  
>  	sup->stx_attributes = STATX_ATTR_AUTOMOUNT;
>  	return sizeof(*sup);
> @@ -202,12 +205,14 @@ static int nfs_fsinfo_get_features(struc
>  	if (server->caps & NFS_CAP_MTIME)
>  		fsinfo_set_feature(ft, FSINFO_FEAT_HAS_MTIME);
>  
> +#if IS_ENABLED(CONFIG_NFS_V4)
>  	if (server->attr_bitmask[0] & FATTR4_WORD0_CASE_INSENSITIVE)
>  		fsinfo_set_feature(ft, FSINFO_FEAT_NAME_CASE_INDEP);
>  	if ((server->attr_bitmask[0] & FATTR4_WORD0_ARCHIVE) ||
>  	    (server->attr_bitmask[0] & FATTR4_WORD0_HIDDEN) ||
>  	    (server->attr_bitmask[1] & FATTR4_WORD1_SYSTEM))
>  		fsinfo_set_feature(ft, FSINFO_FEAT_WINDOWS_ATTRS);
> +#endif
>  
>  	return sizeof(*ft);
>  }

This whole thing needs to be reviewed and acked by the NFS community,
and quite frankly I'm inclined to NAK this. This is the second time
David tries to push this unwanted rewrite of totally unrelated code.

> 
-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com



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

* Re: [PATCH -next] nfs: fsinfo: fix build when CONFIG_NFS_V4 is not enabled
  2020-05-15 17:33 ` Trond Myklebust
@ 2020-05-15 17:36   ` Randy Dunlap
  0 siblings, 0 replies; 4+ messages in thread
From: Randy Dunlap @ 2020-05-15 17:36 UTC (permalink / raw)
  To: Trond Myklebust, linux-kernel, linux-nfs, linux-fsdevel, viro,
	dhowells, anna.schumaker

On 5/15/20 10:33 AM, Trond Myklebust wrote:
> On Fri, 2020-05-15 at 10:27 -0700, Randy Dunlap wrote:
>> From: Randy Dunlap <rdunlap@infradead.org>
>>
>> Fix multiple build errors when CONFIG_NFS_V4 is not enabled.
>>
>> ../fs/nfs/fsinfo.c: In function 'nfs_fsinfo_get_supports':
>> ../fs/nfs/fsinfo.c:153:12: error: 'const struct nfs_server' has no
>> member named 'attr_bitmask'
>>   if (server->attr_bitmask[0] & FATTR4_WORD0_SIZE)
>>             ^~
>> ../fs/nfs/fsinfo.c:155:12: error: 'const struct nfs_server' has no
>> member named 'attr_bitmask'
>>   if (server->attr_bitmask[1] & FATTR4_WORD1_NUMLINKS)
>>             ^~
>> ../fs/nfs/fsinfo.c:158:12: error: 'const struct nfs_server' has no
>> member named 'attr_bitmask'
>>   if (server->attr_bitmask[0] & FATTR4_WORD0_ARCHIVE)
>>             ^~
>> ../fs/nfs/fsinfo.c:160:12: error: 'const struct nfs_server' has no
>> member named 'attr_bitmask'
>>   if (server->attr_bitmask[0] & FATTR4_WORD0_HIDDEN)
>>             ^~
>> ../fs/nfs/fsinfo.c:162:12: error: 'const struct nfs_server' has no
>> member named 'attr_bitmask'
>>   if (server->attr_bitmask[1] & FATTR4_WORD1_SYSTEM)
>>             ^~
>> ../fs/nfs/fsinfo.c: In function 'nfs_fsinfo_get_features':
>> ../fs/nfs/fsinfo.c:205:12: error: 'const struct nfs_server' has no
>> member named 'attr_bitmask'
>>   if (server->attr_bitmask[0] & FATTR4_WORD0_CASE_INSENSITIVE)
>>             ^~
>> ../fs/nfs/fsinfo.c:207:13: error: 'const struct nfs_server' has no
>> member named 'attr_bitmask'
>>   if ((server->attr_bitmask[0] & FATTR4_WORD0_ARCHIVE) ||
>>              ^~
>> ../fs/nfs/fsinfo.c:208:13: error: 'const struct nfs_server' has no
>> member named 'attr_bitmask'
>>       (server->attr_bitmask[0] & FATTR4_WORD0_HIDDEN) ||
>>              ^~
>> ../fs/nfs/fsinfo.c:209:13: error: 'const struct nfs_server' has no
>> member named 'attr_bitmask'
>>       (server->attr_bitmask[1] & FATTR4_WORD1_SYSTEM))
>>              ^~
>>
>>
>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>> Cc: linux-nfs@vger.kernel.org
>> Cc: Trond Myklebust <trond.myklebust@hammerspace.com>
>> Cc: Anna Schumaker <anna.schumaker@netapp.com>
>> Cc: Alexander Viro <viro@zeniv.linux.org.uk>
>> Cc: linux-fsdevel@vger.kernel.org
>> Cc: David Howells <dhowells@redhat.com>
>> ---
>>  fs/nfs/fsinfo.c |    5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> --- linux-next-20200515.orig/fs/nfs/fsinfo.c
>> +++ linux-next-20200515/fs/nfs/fsinfo.c
>> @@ -5,6 +5,7 @@
>>   * Written by David Howells (dhowells@redhat.com)
>>   */
>>  
>> +#include <linux/kconfig.h>
>>  #include <linux/nfs_fs.h>
>>  #include <linux/windows.h>
>>  #include "internal.h"
>> @@ -150,6 +151,7 @@ static int nfs_fsinfo_get_supports(struc
>>  		sup->stx_mask |= STATX_CTIME;
>>  	if (server->caps & NFS_CAP_MTIME)
>>  		sup->stx_mask |= STATX_MTIME;
>> +#if IS_ENABLED(CONFIG_NFS_V4)
>>  	if (server->attr_bitmask[0] & FATTR4_WORD0_SIZE)
>>  		sup->stx_mask |= STATX_SIZE;
>>  	if (server->attr_bitmask[1] & FATTR4_WORD1_NUMLINKS)
>> @@ -161,6 +163,7 @@ static int nfs_fsinfo_get_supports(struc
>>  		sup->win_file_attrs |= ATTR_HIDDEN;
>>  	if (server->attr_bitmask[1] & FATTR4_WORD1_SYSTEM)
>>  		sup->win_file_attrs |= ATTR_SYSTEM;
>> +#endif
>>  
>>  	sup->stx_attributes = STATX_ATTR_AUTOMOUNT;
>>  	return sizeof(*sup);
>> @@ -202,12 +205,14 @@ static int nfs_fsinfo_get_features(struc
>>  	if (server->caps & NFS_CAP_MTIME)
>>  		fsinfo_set_feature(ft, FSINFO_FEAT_HAS_MTIME);
>>  
>> +#if IS_ENABLED(CONFIG_NFS_V4)
>>  	if (server->attr_bitmask[0] & FATTR4_WORD0_CASE_INSENSITIVE)
>>  		fsinfo_set_feature(ft, FSINFO_FEAT_NAME_CASE_INDEP);
>>  	if ((server->attr_bitmask[0] & FATTR4_WORD0_ARCHIVE) ||
>>  	    (server->attr_bitmask[0] & FATTR4_WORD0_HIDDEN) ||
>>  	    (server->attr_bitmask[1] & FATTR4_WORD1_SYSTEM))
>>  		fsinfo_set_feature(ft, FSINFO_FEAT_WINDOWS_ATTRS);
>> +#endif
>>  
>>  	return sizeof(*ft);
>>  }
> 
> This whole thing needs to be reviewed and acked by the NFS community,

Certainly.

> and quite frankly I'm inclined to NAK this. This is the second time
> David tries to push this unwanted rewrite of totally unrelated code.

No problem on that. I just want it to build cleanly.

thanks.
-- 
~Randy


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

* Re: [PATCH -next] nfs: fsinfo: fix build when CONFIG_NFS_V4 is not enabled
  2020-05-15 17:27 [PATCH -next] nfs: fsinfo: fix build when CONFIG_NFS_V4 is not enabled Randy Dunlap
  2020-05-15 17:33 ` Trond Myklebust
@ 2020-05-16 10:53 ` David Howells
  1 sibling, 0 replies; 4+ messages in thread
From: David Howells @ 2020-05-16 10:53 UTC (permalink / raw)
  To: Trond Myklebust
  Cc: dhowells, linux-kernel, linux-nfs, linux-fsdevel, rdunlap, viro,
	anna.schumaker

Trond Myklebust <trondmy@hammerspace.com> wrote:

> This whole thing needs to be reviewed and acked by the NFS community,
> and quite frankly I'm inclined to NAK this. This is the second time
> David tries to push this unwanted rewrite of totally unrelated code.

Rewrite?  What?

It's example code of what NFS could export through this interface.  I didn't
submit it to Linus with the rest of the patches as it's only an example; same
for the ext4 example.  I've tried running it past you and other NFS people a
couple of times to try and elicit a response and wanted to try and ask you
about it at LSF:-(

Anyway, I've dropped it for now.

David


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

end of thread, other threads:[~2020-05-16 10:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-15 17:27 [PATCH -next] nfs: fsinfo: fix build when CONFIG_NFS_V4 is not enabled Randy Dunlap
2020-05-15 17:33 ` Trond Myklebust
2020-05-15 17:36   ` Randy Dunlap
2020-05-16 10:53 ` David Howells

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).