From: kernel test robot <lkp@intel.com>
To: Christoph Hellwig <hch@lst.de>
Cc: oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH 2/4] xfs: clean up the XFS_IOC_FSCOUNTS handler
Date: Mon, 27 Nov 2023 18:19:46 +0800 [thread overview]
Message-ID: <202311271644.IMCBnHFv-lkp@intel.com> (raw)
In-Reply-To: <20231126130124.1251467-3-hch@lst.de>
Hi Christoph,
kernel test robot noticed the following build warnings:
[auto build test WARNING on xfs-linux/for-next]
[also build test WARNING on linus/master v6.7-rc3 next-20231127]
[cannot apply to djwong-xfs/djwong-devel]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Christoph-Hellwig/xfs-clean-up-the-XFS_IOC_FSCOUNTS-handler/20231126-220129
base: https://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git for-next
patch link: https://lore.kernel.org/r/20231126130124.1251467-3-hch%40lst.de
patch subject: [PATCH 2/4] xfs: clean up the XFS_IOC_FSCOUNTS handler
config: i386-randconfig-062-20231126 (https://download.01.org/0day-ci/archive/20231127/202311271644.IMCBnHFv-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231127/202311271644.IMCBnHFv-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/202311271644.IMCBnHFv-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> fs/xfs/xfs_ioctl.c:1918:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __user *to @@ got struct xfs_fsop_counts *uarg @@
fs/xfs/xfs_ioctl.c:1918:26: sparse: expected void [noderef] __user *to
fs/xfs/xfs_ioctl.c:1918:26: sparse: got struct xfs_fsop_counts *uarg
>> fs/xfs/xfs_ioctl.c:2060:48: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected struct xfs_fsop_counts *uarg @@ got void [noderef] __user *arg @@
fs/xfs/xfs_ioctl.c:2060:48: sparse: expected struct xfs_fsop_counts *uarg
fs/xfs/xfs_ioctl.c:2060:48: sparse: got void [noderef] __user *arg
vim +1918 fs/xfs/xfs_ioctl.c
1904
1905 static int
1906 xfs_ioctl_fs_counts(
1907 struct xfs_mount *mp,
1908 struct xfs_fsop_counts *uarg)
1909 {
1910 struct xfs_fsop_counts out = {
1911 .allocino = percpu_counter_read_positive(&mp->m_icount),
1912 .freeino = percpu_counter_read_positive(&mp->m_ifree),
1913 .freedata = percpu_counter_read_positive(&mp->m_fdblocks) -
1914 xfs_fdblocks_unavailable(mp),
1915 .freertx = percpu_counter_read_positive(&mp->m_frextents),
1916 };
1917
> 1918 if (copy_to_user(uarg, &out, sizeof(out)))
1919 return -EFAULT;
1920 return 0;
1921 }
1922
1923 /*
1924 * These long-unused ioctls were removed from the official ioctl API in 5.17,
1925 * but retain these definitions so that we can log warnings about them.
1926 */
1927 #define XFS_IOC_ALLOCSP _IOW ('X', 10, struct xfs_flock64)
1928 #define XFS_IOC_FREESP _IOW ('X', 11, struct xfs_flock64)
1929 #define XFS_IOC_ALLOCSP64 _IOW ('X', 36, struct xfs_flock64)
1930 #define XFS_IOC_FREESP64 _IOW ('X', 37, struct xfs_flock64)
1931
1932 /*
1933 * Note: some of the ioctl's return positive numbers as a
1934 * byte count indicating success, such as readlink_by_handle.
1935 * So we don't "sign flip" like most other routines. This means
1936 * true errors need to be returned as a negative value.
1937 */
1938 long
1939 xfs_file_ioctl(
1940 struct file *filp,
1941 unsigned int cmd,
1942 unsigned long p)
1943 {
1944 struct inode *inode = file_inode(filp);
1945 struct xfs_inode *ip = XFS_I(inode);
1946 struct xfs_mount *mp = ip->i_mount;
1947 void __user *arg = (void __user *)p;
1948 int error;
1949
1950 trace_xfs_file_ioctl(ip);
1951
1952 switch (cmd) {
1953 case FITRIM:
1954 return xfs_ioc_trim(mp, arg);
1955 case FS_IOC_GETFSLABEL:
1956 return xfs_ioc_getlabel(mp, arg);
1957 case FS_IOC_SETFSLABEL:
1958 return xfs_ioc_setlabel(filp, mp, arg);
1959 case XFS_IOC_ALLOCSP:
1960 case XFS_IOC_FREESP:
1961 case XFS_IOC_ALLOCSP64:
1962 case XFS_IOC_FREESP64:
1963 xfs_warn_once(mp,
1964 "%s should use fallocate; XFS_IOC_{ALLOC,FREE}SP ioctl unsupported",
1965 current->comm);
1966 return -ENOTTY;
1967 case XFS_IOC_DIOINFO: {
1968 struct xfs_buftarg *target = xfs_inode_buftarg(ip);
1969 struct dioattr da;
1970
1971 da.d_mem = da.d_miniosz = target->bt_logical_sectorsize;
1972 da.d_maxiosz = INT_MAX & ~(da.d_miniosz - 1);
1973
1974 if (copy_to_user(arg, &da, sizeof(da)))
1975 return -EFAULT;
1976 return 0;
1977 }
1978
1979 case XFS_IOC_FSBULKSTAT_SINGLE:
1980 case XFS_IOC_FSBULKSTAT:
1981 case XFS_IOC_FSINUMBERS:
1982 return xfs_ioc_fsbulkstat(filp, cmd, arg);
1983
1984 case XFS_IOC_BULKSTAT:
1985 return xfs_ioc_bulkstat(filp, cmd, arg);
1986 case XFS_IOC_INUMBERS:
1987 return xfs_ioc_inumbers(mp, cmd, arg);
1988
1989 case XFS_IOC_FSGEOMETRY_V1:
1990 return xfs_ioc_fsgeometry(mp, arg, 3);
1991 case XFS_IOC_FSGEOMETRY_V4:
1992 return xfs_ioc_fsgeometry(mp, arg, 4);
1993 case XFS_IOC_FSGEOMETRY:
1994 return xfs_ioc_fsgeometry(mp, arg, 5);
1995
1996 case XFS_IOC_AG_GEOMETRY:
1997 return xfs_ioc_ag_geometry(mp, arg);
1998
1999 case XFS_IOC_GETVERSION:
2000 return put_user(inode->i_generation, (int __user *)arg);
2001
2002 case XFS_IOC_FSGETXATTRA:
2003 return xfs_ioc_fsgetxattra(ip, arg);
2004
2005 case XFS_IOC_GETBMAP:
2006 case XFS_IOC_GETBMAPA:
2007 case XFS_IOC_GETBMAPX:
2008 return xfs_ioc_getbmap(filp, cmd, arg);
2009
2010 case FS_IOC_GETFSMAP:
2011 return xfs_ioc_getfsmap(ip, arg);
2012
2013 case XFS_IOC_SCRUB_METADATA:
2014 return xfs_ioc_scrub_metadata(filp, arg);
2015
2016 case XFS_IOC_FD_TO_HANDLE:
2017 case XFS_IOC_PATH_TO_HANDLE:
2018 case XFS_IOC_PATH_TO_FSHANDLE: {
2019 xfs_fsop_handlereq_t hreq;
2020
2021 if (copy_from_user(&hreq, arg, sizeof(hreq)))
2022 return -EFAULT;
2023 return xfs_find_handle(cmd, &hreq);
2024 }
2025 case XFS_IOC_OPEN_BY_HANDLE: {
2026 xfs_fsop_handlereq_t hreq;
2027
2028 if (copy_from_user(&hreq, arg, sizeof(xfs_fsop_handlereq_t)))
2029 return -EFAULT;
2030 return xfs_open_by_handle(filp, &hreq);
2031 }
2032
2033 case XFS_IOC_READLINK_BY_HANDLE: {
2034 xfs_fsop_handlereq_t hreq;
2035
2036 if (copy_from_user(&hreq, arg, sizeof(xfs_fsop_handlereq_t)))
2037 return -EFAULT;
2038 return xfs_readlink_by_handle(filp, &hreq);
2039 }
2040 case XFS_IOC_ATTRLIST_BY_HANDLE:
2041 return xfs_attrlist_by_handle(filp, arg);
2042
2043 case XFS_IOC_ATTRMULTI_BY_HANDLE:
2044 return xfs_attrmulti_by_handle(filp, arg);
2045
2046 case XFS_IOC_SWAPEXT: {
2047 struct xfs_swapext sxp;
2048
2049 if (copy_from_user(&sxp, arg, sizeof(xfs_swapext_t)))
2050 return -EFAULT;
2051 error = mnt_want_write_file(filp);
2052 if (error)
2053 return error;
2054 error = xfs_ioc_swapext(&sxp);
2055 mnt_drop_write_file(filp);
2056 return error;
2057 }
2058
2059 case XFS_IOC_FSCOUNTS:
> 2060 return xfs_ioctl_fs_counts(mp, arg);
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2023-11-27 10:20 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-26 13:01 misc cleanups to the resblks interfaces Christoph Hellwig
2023-11-26 13:01 ` [PATCH 1/4] xfs: clean up the XFS_IOC_{GS}ET_RESBLKS handler Christoph Hellwig
2023-11-28 1:53 ` Darrick J. Wong
2023-11-26 13:01 ` [PATCH 2/4] xfs: clean up the XFS_IOC_FSCOUNTS handler Christoph Hellwig
2023-11-27 10:19 ` kernel test robot [this message]
2023-11-27 16:40 ` Christoph Hellwig
2023-11-28 1:58 ` Darrick J. Wong
2023-11-28 5:30 ` Christoph Hellwig
2023-12-03 6:31 ` kernel test robot
2023-11-26 13:01 ` [PATCH 3/4] xfs: clean up the xfs_reserve_blocks interface Christoph Hellwig
2023-11-28 2:09 ` Darrick J. Wong
2023-11-28 5:32 ` Christoph Hellwig
2023-11-26 13:01 ` [PATCH 4/4] xfs: clean up xfs_fsops.h Christoph Hellwig
2023-11-28 1:51 ` Darrick J. Wong
-- strict thread matches above, loose matches on Subject: below --
2023-12-04 17:40 misc cleanups to the resblks interfaces v2 Christoph Hellwig
2023-12-04 17:40 ` [PATCH 2/4] xfs: clean up the XFS_IOC_FSCOUNTS handler Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202311271644.IMCBnHFv-lkp@intel.com \
--to=lkp@intel.com \
--cc=hch@lst.de \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.