All of lore.kernel.org
 help / color / mirror / Atom feed
* [smfrench-smb3:ksmbd-for-next-next 4/4] fs/smb/server/smb2pdu.c:2061: warning: Function parameter or struct member 'is_dir' not described in 'smb2_create_open_flags'
@ 2024-07-04 18:14 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-07-04 18:14 UTC (permalink / raw)
  To: Steve French; +Cc: oe-kbuild-all

tree:   https://github.com/smfrench/smb3-kernel.git ksmbd-for-next-next
head:   cbd22525a55a8f74c730b254d708f8e92bb8dc53
commit: cbd22525a55a8f74c730b254d708f8e92bb8dc53 [4/4] ksmbd: discard write access to the directory open
config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20240705/202407050244.1nLPnfIn-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240705/202407050244.1nLPnfIn-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202407050244.1nLPnfIn-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/smb/server/smb2pdu.c:2061: warning: Function parameter or struct member 'is_dir' not described in 'smb2_create_open_flags'


vim +2061 fs/smb/server/smb2pdu.c

e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2047  
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2048  /**
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2049   * smb2_create_open_flags() - convert smb open flags to unix open flags
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2050   * @file_present:	is file already present
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2051   * @access:		file access flags
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2052   * @disposition:	file disposition flags
6c5e36d13e2a33 fs/ksmbd/smb2pdu.c      Hyunchul Lee 2021-06-23  2053   * @may_flags:		set with MAY_ flags
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2054   *
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2055   * Return:      file open flags
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2056   */
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2057  static int smb2_create_open_flags(bool file_present, __le32 access,
6c5e36d13e2a33 fs/ksmbd/smb2pdu.c      Hyunchul Lee 2021-06-23  2058  				  __le32 disposition,
cbd22525a55a8f fs/smb/server/smb2pdu.c Hobin Woo    2024-07-04  2059  				  int *may_flags,
cbd22525a55a8f fs/smb/server/smb2pdu.c Hobin Woo    2024-07-04  2060  				  bool is_dir)
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16 @2061  {
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2062  	int oflags = O_NONBLOCK | O_LARGEFILE;
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2063  
cbd22525a55a8f fs/smb/server/smb2pdu.c Hobin Woo    2024-07-04  2064  	if (is_dir) {
cbd22525a55a8f fs/smb/server/smb2pdu.c Hobin Woo    2024-07-04  2065  		access &= ~FILE_WRITE_DESIRE_ACCESS_LE;
cbd22525a55a8f fs/smb/server/smb2pdu.c Hobin Woo    2024-07-04  2066  		ksmbd_debug(SMB, "Discard write access to a directory\n");
cbd22525a55a8f fs/smb/server/smb2pdu.c Hobin Woo    2024-07-04  2067  	}
cbd22525a55a8f fs/smb/server/smb2pdu.c Hobin Woo    2024-07-04  2068  
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2069  	if (access & FILE_READ_DESIRED_ACCESS_LE &&
6c5e36d13e2a33 fs/ksmbd/smb2pdu.c      Hyunchul Lee 2021-06-23  2070  	    access & FILE_WRITE_DESIRE_ACCESS_LE) {
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2071  		oflags |= O_RDWR;
6c5e36d13e2a33 fs/ksmbd/smb2pdu.c      Hyunchul Lee 2021-06-23  2072  		*may_flags = MAY_OPEN | MAY_READ | MAY_WRITE;
6c5e36d13e2a33 fs/ksmbd/smb2pdu.c      Hyunchul Lee 2021-06-23  2073  	} else if (access & FILE_WRITE_DESIRE_ACCESS_LE) {
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2074  		oflags |= O_WRONLY;
6c5e36d13e2a33 fs/ksmbd/smb2pdu.c      Hyunchul Lee 2021-06-23  2075  		*may_flags = MAY_OPEN | MAY_WRITE;
6c5e36d13e2a33 fs/ksmbd/smb2pdu.c      Hyunchul Lee 2021-06-23  2076  	} else {
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2077  		oflags |= O_RDONLY;
6c5e36d13e2a33 fs/ksmbd/smb2pdu.c      Hyunchul Lee 2021-06-23  2078  		*may_flags = MAY_OPEN | MAY_READ;
6c5e36d13e2a33 fs/ksmbd/smb2pdu.c      Hyunchul Lee 2021-06-23  2079  	}
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2080  
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2081  	if (access == FILE_READ_ATTRIBUTES_LE)
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2082  		oflags |= O_PATH;
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2083  
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2084  	if (file_present) {
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2085  		switch (disposition & FILE_CREATE_MASK_LE) {
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2086  		case FILE_OPEN_LE:
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2087  		case FILE_CREATE_LE:
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2088  			break;
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2089  		case FILE_SUPERSEDE_LE:
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2090  		case FILE_OVERWRITE_LE:
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2091  		case FILE_OVERWRITE_IF_LE:
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2092  			oflags |= O_TRUNC;
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2093  			break;
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2094  		default:
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2095  			break;
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2096  		}
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2097  	} else {
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2098  		switch (disposition & FILE_CREATE_MASK_LE) {
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2099  		case FILE_SUPERSEDE_LE:
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2100  		case FILE_CREATE_LE:
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2101  		case FILE_OPEN_IF_LE:
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2102  		case FILE_OVERWRITE_IF_LE:
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2103  			oflags |= O_CREAT;
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2104  			break;
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2105  		case FILE_OPEN_LE:
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2106  		case FILE_OVERWRITE_LE:
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2107  			oflags &= ~O_CREAT;
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2108  			break;
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2109  		default:
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2110  			break;
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2111  		}
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2112  	}
6c5e36d13e2a33 fs/ksmbd/smb2pdu.c      Hyunchul Lee 2021-06-23  2113  
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2114  	return oflags;
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2115  }
e2f34481b24db2 fs/cifsd/smb2pdu.c      Namjae Jeon  2021-03-16  2116  

:::::: The code at line 2061 was first introduced by commit
:::::: e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 cifsd: add server-side procedures for SMB3

:::::: TO: Namjae Jeon <namjae.jeon@samsung.com>
:::::: CC: Steve French <stfrench@microsoft.com>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-07-04 18:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-04 18:14 [smfrench-smb3:ksmbd-for-next-next 4/4] fs/smb/server/smb2pdu.c:2061: warning: Function parameter or struct member 'is_dir' not described in 'smb2_create_open_flags' kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.