All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v2 4/4] fuse: support changing per-file DAX flag inside guest
@ 2021-07-27 18:31 kernel test robot
  2021-07-28  0:39   ` kernel test robot
  0 siblings, 1 reply; 7+ messages in thread
From: kernel test robot @ 2021-07-27 18:31 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 15805 bytes --]

CC: clang-built-linux(a)googlegroups.com
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20210716104753.74377-5-jefflexu@linux.alibaba.com>
References: <20210716104753.74377-5-jefflexu@linux.alibaba.com>
TO: Jeffle Xu <jefflexu@linux.alibaba.com>
TO: vgoyal(a)redhat.com
TO: stefanha(a)redhat.com
TO: miklos(a)szeredi.hu
CC: linux-fsdevel(a)vger.kernel.org
CC: virtualization(a)lists.linux-foundation.org
CC: bo.liu(a)linux.alibaba.com
CC: joseph.qi(a)linux.alibaba.com

Hi Jeffle,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on fuse/for-next]
[also build test WARNING on v5.14-rc3 next-20210726]
[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]

url:    https://github.com/0day-ci/linux/commits/Jeffle-Xu/virtiofs-fuse-support-per-file-DAX/20210718-102250
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git for-next
:::::: branch date: 10 days ago
:::::: commit date: 10 days ago
config: x86_64-randconfig-c001-20210727 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project c658b472f3e61e1818e1909bf02f3d65470018a5)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://github.com/0day-ci/linux/commit/a6ac625f19c4c4de28ee8a466c1bab8824b7042e
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Jeffle-Xu/virtiofs-fuse-support-per-file-DAX/20210718-102250
        git checkout a6ac625f19c4c4de28ee8a466c1bab8824b7042e
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
   drivers/regulator/qcom_spmi-regulator.c:1155:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
           ret = spmi_vreg_update_bits(vreg, SPMI_COMMON_REG_ENABLE,
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/qcom_spmi-regulator.c:1155:2: note: Value stored to 'ret' is never read
           ret = spmi_vreg_update_bits(vreg, SPMI_COMMON_REG_ENABLE,
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   7 warnings generated.
   drivers/regulator/palmas-regulator.c:1598:36: warning: Value stored to 'pdata' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct palmas_pmic_platform_data *pdata = dev_get_platdata(&pdev->dev);
                                             ^~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/palmas-regulator.c:1598:36: note: Value stored to 'pdata' during its initialization is never read
           struct palmas_pmic_platform_data *pdata = dev_get_platdata(&pdev->dev);
                                             ^~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   7 warnings generated.
   drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:49:39: warning: Dereference of null pointer [clang-analyzer-core.NullDereference]
                           const struct nvkm_vmm_desc *pair = page[-1].desc;
                                                              ^
   drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1145:8: note: Assuming  is non-null
           if (!(*pvmm = kzalloc(sizeof(**pvmm), GFP_KERNEL)))
                 ^~~~~
   drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1145:2: note: Taking false branch
           if (!(*pvmm = kzalloc(sizeof(**pvmm), GFP_KERNEL)))
           ^
   drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1147:9: note: Calling 'nvkm_vmm_ctor'
           return nvkm_vmm_ctor(func, mmu, hdr, managed, addr, size, key, name, *pvmm);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1051:43: note: Assuming 'key' is null
           __mutex_init(&vmm->mutex, "&vmm->mutex", key ? key : &_key);
                                                    ^~~
   drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1051:43: note: '?' condition is false
   drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1056:2: note: Loop condition is false. Execution continues on line 1063
           while (page[1].shift)
           ^
   drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1063:2: note: Loop condition is false. Execution continues on line 1065
           for (levels = 0, desc = page->desc; desc->bits; desc++, levels++)
           ^
   drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1068:6: note: Taking false branch
           if (WARN_ON(levels > NVKM_VMM_LEVELS_MAX))
               ^
   include/asm-generic/bug.h:120:2: note: expanded from macro 'WARN_ON'
           if (unlikely(__ret_warn_on))                                    \
           ^
   drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1068:2: note: Taking false branch
           if (WARN_ON(levels > NVKM_VMM_LEVELS_MAX))
           ^
   drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1072:41: note: Passing null pointer value via 3rd parameter 'page'
           vmm->pd = nvkm_vmm_pt_new(desc, false, NULL);
                                                  ^
   include/linux/stddef.h:8:14: note: expanded from macro 'NULL'
   #define NULL ((void *)0)
                ^~~~~~~~~~~
   drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1072:12: note: Calling 'nvkm_vmm_pt_new'
           vmm->pd = nvkm_vmm_pt_new(desc, false, NULL);
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:47:6: note: Assuming field 'type' is > PGT
           if (desc->type > PGT) {
               ^~~~~~~~~~~~~~~~
   drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:47:2: note: Taking true branch
           if (desc->type > PGT) {
           ^
   drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:48:7: note: Assuming field 'type' is equal to SPT
                   if (desc->type == SPT) {
                       ^~~~~~~~~~~~~~~~~
   drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:48:3: note: Taking true branch
                   if (desc->type == SPT) {
                   ^
   drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:49:39: note: Dereference of null pointer
                           const struct nvkm_vmm_desc *pair = page[-1].desc;
                                                              ^~~~~~~~~~~~~
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   8 warnings generated.
>> fs/fuse/ioctl.c:471:3: warning: Value stored to 'newdax' is never read [clang-analyzer-deadcode.DeadStores]
                   newdax = flags & FS_DAX_FL;
                   ^        ~~~~~~~~~~~~~~~~~
   fs/fuse/ioctl.c:471:3: note: Value stored to 'newdax' is never read
                   newdax = flags & FS_DAX_FL;
                   ^        ~~~~~~~~~~~~~~~~~
   fs/fuse/ioctl.c:482:3: warning: Value stored to 'newdax' is never read [clang-analyzer-deadcode.DeadStores]
                   newdax = fa->fsx_xflags & FS_XFLAG_DAX;
                   ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/fuse/ioctl.c:482:3: note: Value stored to 'newdax' is never read
                   newdax = fa->fsx_xflags & FS_XFLAG_DAX;
                   ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   8 warnings generated.
   fs/fuse/cuse.c:359:2: warning: Value stored to 'rc' is never read [clang-analyzer-deadcode.DeadStores]
           rc = -ENOMEM;
           ^    ~~~~~~~
   fs/fuse/cuse.c:359:2: note: Value stored to 'rc' is never read
           rc = -ENOMEM;
           ^    ~~~~~~~
   fs/fuse/cuse.c:386:2: warning: Value stored to 'rc' is never read [clang-analyzer-deadcode.DeadStores]
           rc = -ENOMEM;
           ^    ~~~~~~~
   fs/fuse/cuse.c:386:2: note: Value stored to 'rc' is never read
           rc = -ENOMEM;
           ^    ~~~~~~~
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   8 warnings generated.
   fs/fuse/virtio_fs.c:912:2: warning: Attempt to free released memory [clang-analyzer-unix.Malloc]
           kfree(fs->vqs);
           ^~~~~~~~~~~~~~
   fs/fuse/virtio_fs.c:879:6: note: Assuming 'fs' is non-null
           if (!fs)
               ^~~
   fs/fuse/virtio_fs.c:879:2: note: Taking false branch
           if (!fs)
           ^
   fs/fuse/virtio_fs.c:885:6: note: 'ret' is >= 0
           if (ret < 0)
               ^~~
   fs/fuse/virtio_fs.c:885:2: note: Taking false branch
           if (ret < 0)
           ^
   fs/fuse/virtio_fs.c:888:8: note: Calling 'virtio_fs_setup_vqs'
           ret = virtio_fs_setup_vqs(vdev, fs);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/fuse/virtio_fs.c:691:2: note: Loop condition is false.  Exiting loop
           virtio_cread_le(vdev, struct virtio_fs_config, num_request_queues,
           ^
   include/linux/virtio_config.h:396:3: note: expanded from macro 'virtio_cread_le'
                   might_sleep();                                          \
                   ^
   include/linux/kernel.h:119:2: note: expanded from macro 'might_sleep'
           do { __might_sleep(__FILE__, __LINE__, 0); might_resched(); } while (0)
           ^
   fs/fuse/virtio_fs.c:691:2: note: Control jumps to 'case 4:' @line 691
           virtio_cread_le(vdev, struct virtio_fs_config, num_request_queues,
           ^
   include/linux/virtio_config.h:400:3: note: expanded from macro 'virtio_cread_le'
                   switch (sizeof(virtio_cread_v)) {                       \
                   ^
   fs/fuse/virtio_fs.c:691:2: note:  Execution continues on line 691
           virtio_cread_le(vdev, struct virtio_fs_config, num_request_queues,
           ^
   include/linux/virtio_config.h:408:4: note: expanded from macro 'virtio_cread_le'
                           break;                                          \
                           ^
   fs/fuse/virtio_fs.c:691:2: note: Loop condition is false.  Exiting loop
           virtio_cread_le(vdev, struct virtio_fs_config, num_request_queues,
           ^
   include/linux/virtio_config.h:393:2: note: expanded from macro 'virtio_cread_le'
           do {                                                            \
           ^
   fs/fuse/virtio_fs.c:693:6: note: Assuming field 'num_request_queues' is not equal to 0
           if (fs->num_request_queues == 0)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/fuse/virtio_fs.c:693:2: note: Taking false branch
           if (fs->num_request_queues == 0)
           ^
   fs/fuse/virtio_fs.c:698:6: note: Assuming field 'vqs' is non-null
           if (!fs->vqs)
               ^~~~~~~~
   fs/fuse/virtio_fs.c:698:2: note: Taking false branch
           if (!fs->vqs)
           ^
   fs/fuse/virtio_fs.c:705:6: note: Assuming 'vqs' is non-null
           if (!vqs || !callbacks || !names) {
               ^~~~
   fs/fuse/virtio_fs.c:705:6: note: Left side of '||' is false
   fs/fuse/virtio_fs.c:705:14: note: Assuming 'callbacks' is non-null
           if (!vqs || !callbacks || !names) {
                       ^~~~~~~~~~
   fs/fuse/virtio_fs.c:705:6: note: Left side of '||' is false
           if (!vqs || !callbacks || !names) {
               ^
   fs/fuse/virtio_fs.c:705:28: note: Assuming 'names' is non-null
           if (!vqs || !callbacks || !names) {
                                     ^~~~~~
   fs/fuse/virtio_fs.c:705:2: note: Taking false branch

vim +/newdax +471 fs/fuse/ioctl.c

72227eac177dd1 Miklos Szeredi 2021-04-08  455  
72227eac177dd1 Miklos Szeredi 2021-04-08  456  int fuse_fileattr_set(struct user_namespace *mnt_userns,
72227eac177dd1 Miklos Szeredi 2021-04-08  457  		      struct dentry *dentry, struct fileattr *fa)
72227eac177dd1 Miklos Szeredi 2021-04-08  458  {
72227eac177dd1 Miklos Szeredi 2021-04-08  459  	struct inode *inode = d_inode(dentry);
72227eac177dd1 Miklos Szeredi 2021-04-08  460  	struct fuse_file *ff;
72227eac177dd1 Miklos Szeredi 2021-04-08  461  	unsigned int flags = fa->flags;
72227eac177dd1 Miklos Szeredi 2021-04-08  462  	struct fsxattr xfa;
a6ac625f19c4c4 Jeffle Xu      2021-07-16  463  	bool newdax;
72227eac177dd1 Miklos Szeredi 2021-04-08  464  	int err;
72227eac177dd1 Miklos Szeredi 2021-04-08  465  
72227eac177dd1 Miklos Szeredi 2021-04-08  466  	ff = fuse_priv_ioctl_prepare(inode);
72227eac177dd1 Miklos Szeredi 2021-04-08  467  	if (IS_ERR(ff))
72227eac177dd1 Miklos Szeredi 2021-04-08  468  		return PTR_ERR(ff);
72227eac177dd1 Miklos Szeredi 2021-04-08  469  
72227eac177dd1 Miklos Szeredi 2021-04-08  470  	if (fa->flags_valid) {
a6ac625f19c4c4 Jeffle Xu      2021-07-16 @471  		newdax = flags & FS_DAX_FL;

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34402 bytes --]

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

* Re: [PATCH v2 4/4] fuse: support changing per-file DAX flag inside guest
  2021-07-27 18:31 [PATCH v2 4/4] fuse: support changing per-file DAX flag inside guest kernel test robot
@ 2021-07-28  0:39   ` kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2021-07-28  0:39 UTC (permalink / raw)
  To: Jeffle Xu, vgoyal, stefanha, miklos
  Cc: clang-built-linux, kbuild-all, linux-fsdevel, virtualization,
	bo.liu, joseph.qi

[-- Attachment #1: Type: text/plain, Size: 15154 bytes --]


Hi Jeffle,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on fuse/for-next]
[also build test WARNING on v5.14-rc3 next-20210726]
[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]

url: 
https://github.com/0day-ci/linux/commits/Jeffle-Xu/virtiofs-fuse-support-per-file-DAX/20210718-102250
base: 
https://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git for-next
:::::: branch date: 10 days ago
:::::: commit date: 10 days ago
config: x86_64-randconfig-c001-20210727 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 
c658b472f3e61e1818e1909bf02f3d65470018a5)
reproduce (this is a W=1 build):
         wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross 
-O ~/bin/make.cross
         chmod +x ~/bin/make.cross
         # install x86_64 cross compiling tool for clang build
         # apt-get install binutils-x86-64-linux-gnu
         # 
https://github.com/0day-ci/linux/commit/a6ac625f19c4c4de28ee8a466c1bab8824b7042e
         git remote add linux-review https://github.com/0day-ci/linux
         git fetch --no-tags linux-review 
Jeffle-Xu/virtiofs-fuse-support-per-file-DAX/20210718-102250
         git checkout a6ac625f19c4c4de28ee8a466c1bab8824b7042e
         # save the attached .config to linux build tree
         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross 
ARCH=x86_64 clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
    drivers/regulator/qcom_spmi-regulator.c:1155:2: warning: Value 
stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
            ret = spmi_vreg_update_bits(vreg, SPMI_COMMON_REG_ENABLE,
            ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/regulator/qcom_spmi-regulator.c:1155:2: note: Value stored 
to 'ret' is never read
            ret = spmi_vreg_update_bits(vreg, SPMI_COMMON_REG_ENABLE,
            ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Suppressed 6 warnings (6 in non-user code).
    Use -header-filter=.* to display errors from all non-system headers. 
Use -system-headers to display errors from system headers as well.
    6 warnings generated.
    Suppressed 6 warnings (6 in non-user code).
    Use -header-filter=.* to display errors from all non-system headers. 
Use -system-headers to display errors from system headers as well.
    7 warnings generated.
    drivers/regulator/palmas-regulator.c:1598:36: warning: Value stored 
to 'pdata' during its initialization is never read 
[clang-analyzer-deadcode.DeadStores]
            struct palmas_pmic_platform_data *pdata = 
dev_get_platdata(&pdev->dev);
                                              ^~~~~ 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/regulator/palmas-regulator.c:1598:36: note: Value stored to 
'pdata' during its initialization is never read
            struct palmas_pmic_platform_data *pdata = 
dev_get_platdata(&pdev->dev);
                                              ^~~~~ 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Suppressed 6 warnings (6 in non-user code).
    Use -header-filter=.* to display errors from all non-system headers. 
Use -system-headers to display errors from system headers as well.
    6 warnings generated.
    Suppressed 6 warnings (6 in non-user code).
    Use -header-filter=.* to display errors from all non-system headers. 
Use -system-headers to display errors from system headers as well.
    5 warnings generated.
    Suppressed 5 warnings (5 in non-user code).
    Use -header-filter=.* to display errors from all non-system headers. 
Use -system-headers to display errors from system headers as well.
    5 warnings generated.
    Suppressed 5 warnings (5 in non-user code).
    Use -header-filter=.* to display errors from all non-system headers. 
Use -system-headers to display errors from system headers as well.
    7 warnings generated.
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:49:39: warning: 
Dereference of null pointer [clang-analyzer-core.NullDereference]
                            const struct nvkm_vmm_desc *pair = 
page[-1].desc;
                                                               ^
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1145:8: note: Assuming 
  is non-null
            if (!(*pvmm = kzalloc(sizeof(**pvmm), GFP_KERNEL)))
                  ^~~~~
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1145:2: note: Taking 
false branch
            if (!(*pvmm = kzalloc(sizeof(**pvmm), GFP_KERNEL)))
            ^
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1147:9: note: Calling 
'nvkm_vmm_ctor'
            return nvkm_vmm_ctor(func, mmu, hdr, managed, addr, size, 
key, name, *pvmm);
 
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1051:43: note: 
Assuming 'key' is null
            __mutex_init(&vmm->mutex, "&vmm->mutex", key ? key : &_key);
                                                     ^~~
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1051:43: note: '?' 
condition is false
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1056:2: note: Loop 
condition is false. Execution continues on line 1063
            while (page[1].shift)
            ^
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1063:2: note: Loop 
condition is false. Execution continues on line 1065
            for (levels = 0, desc = page->desc; desc->bits; desc++, 
levels++)
            ^
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1068:6: note: Taking 
false branch
            if (WARN_ON(levels > NVKM_VMM_LEVELS_MAX))
                ^
    include/asm-generic/bug.h:120:2: note: expanded from macro 'WARN_ON'
            if (unlikely(__ret_warn_on)) 
     \
            ^
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1068:2: note: Taking 
false branch
            if (WARN_ON(levels > NVKM_VMM_LEVELS_MAX))
            ^
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1072:41: note: Passing 
null pointer value via 3rd parameter 'page'
            vmm->pd = nvkm_vmm_pt_new(desc, false, NULL);
                                                   ^
    include/linux/stddef.h:8:14: note: expanded from macro 'NULL'
    #define NULL ((void *)0)
                 ^~~~~~~~~~~
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1072:12: note: Calling 
'nvkm_vmm_pt_new'
            vmm->pd = nvkm_vmm_pt_new(desc, false, NULL);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:47:6: note: Assuming 
field 'type' is > PGT
            if (desc->type > PGT) {
                ^~~~~~~~~~~~~~~~
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:47:2: note: Taking 
true branch
            if (desc->type > PGT) {
            ^
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:48:7: note: Assuming 
field 'type' is equal to SPT
                    if (desc->type == SPT) {
                        ^~~~~~~~~~~~~~~~~
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:48:3: note: Taking 
true branch
                    if (desc->type == SPT) {
                    ^
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:49:39: note: 
Dereference of null pointer
                            const struct nvkm_vmm_desc *pair = 
page[-1].desc;
                                                               ^~~~~~~~~~~~~
    Suppressed 6 warnings (6 in non-user code).
    Use -header-filter=.* to display errors from all non-system headers. 
Use -system-headers to display errors from system headers as well.
    6 warnings generated.
    Suppressed 6 warnings (6 in non-user code).
    Use -header-filter=.* to display errors from all non-system headers. 
Use -system-headers to display errors from system headers as well.
    6 warnings generated.
    Suppressed 6 warnings (6 in non-user code).
    Use -header-filter=.* to display errors from all non-system headers. 
Use -system-headers to display errors from system headers as well.
    6 warnings generated.
    Suppressed 6 warnings (6 in non-user code).
    Use -header-filter=.* to display errors from all non-system headers. 
Use -system-headers to display errors from system headers as well.
    6 warnings generated.
    Suppressed 6 warnings (6 in non-user code).
    Use -header-filter=.* to display errors from all non-system headers. 
Use -system-headers to display errors from system headers as well.
    8 warnings generated.
>> fs/fuse/ioctl.c:471:3: warning: Value stored to 'newdax' is never read [clang-analyzer-deadcode.DeadStores]
                    newdax = flags & FS_DAX_FL;
                    ^        ~~~~~~~~~~~~~~~~~
    fs/fuse/ioctl.c:471:3: note: Value stored to 'newdax' is never read
                    newdax = flags & FS_DAX_FL;
                    ^        ~~~~~~~~~~~~~~~~~
    fs/fuse/ioctl.c:482:3: warning: Value stored to 'newdax' is never 
read [clang-analyzer-deadcode.DeadStores]
                    newdax = fa->fsx_xflags & FS_XFLAG_DAX;
                    ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    fs/fuse/ioctl.c:482:3: note: Value stored to 'newdax' is never read
                    newdax = fa->fsx_xflags & FS_XFLAG_DAX;
                    ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Suppressed 6 warnings (6 in non-user code).
    Use -header-filter=.* to display errors from all non-system headers. 
Use -system-headers to display errors from system headers as well.
    8 warnings generated.
    fs/fuse/cuse.c:359:2: warning: Value stored to 'rc' is never read 
[clang-analyzer-deadcode.DeadStores]
            rc = -ENOMEM;
            ^    ~~~~~~~
    fs/fuse/cuse.c:359:2: note: Value stored to 'rc' is never read
            rc = -ENOMEM;
            ^    ~~~~~~~
    fs/fuse/cuse.c:386:2: warning: Value stored to 'rc' is never read 
[clang-analyzer-deadcode.DeadStores]
            rc = -ENOMEM;
            ^    ~~~~~~~
    fs/fuse/cuse.c:386:2: note: Value stored to 'rc' is never read
            rc = -ENOMEM;
            ^    ~~~~~~~
    Suppressed 6 warnings (6 in non-user code).
    Use -header-filter=.* to display errors from all non-system headers. 
Use -system-headers to display errors from system headers as well.
    8 warnings generated.
    fs/fuse/virtio_fs.c:912:2: warning: Attempt to free released memory 
[clang-analyzer-unix.Malloc]
            kfree(fs->vqs);
            ^~~~~~~~~~~~~~
    fs/fuse/virtio_fs.c:879:6: note: Assuming 'fs' is non-null
            if (!fs)
                ^~~
    fs/fuse/virtio_fs.c:879:2: note: Taking false branch
            if (!fs)
            ^
    fs/fuse/virtio_fs.c:885:6: note: 'ret' is >= 0
            if (ret < 0)
                ^~~
    fs/fuse/virtio_fs.c:885:2: note: Taking false branch
            if (ret < 0)
            ^
    fs/fuse/virtio_fs.c:888:8: note: Calling 'virtio_fs_setup_vqs'
            ret = virtio_fs_setup_vqs(vdev, fs);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    fs/fuse/virtio_fs.c:691:2: note: Loop condition is false.  Exiting loop
            virtio_cread_le(vdev, struct virtio_fs_config, 
num_request_queues,
            ^
    include/linux/virtio_config.h:396:3: note: expanded from macro 
'virtio_cread_le'
                    might_sleep(); 
     \
                    ^
    include/linux/kernel.h:119:2: note: expanded from macro 'might_sleep'
            do { __might_sleep(__FILE__, __LINE__, 0); might_resched(); 
} while (0)
            ^
    fs/fuse/virtio_fs.c:691:2: note: Control jumps to 'case 4:'  at line 691
            virtio_cread_le(vdev, struct virtio_fs_config, 
num_request_queues,
            ^
    include/linux/virtio_config.h:400:3: note: expanded from macro 
'virtio_cread_le'
                    switch (sizeof(virtio_cread_v)) { 
     \
                    ^
    fs/fuse/virtio_fs.c:691:2: note:  Execution continues on line 691
            virtio_cread_le(vdev, struct virtio_fs_config, 
num_request_queues,
            ^
    include/linux/virtio_config.h:408:4: note: expanded from macro 
'virtio_cread_le'
                            break; 
     \
                            ^
    fs/fuse/virtio_fs.c:691:2: note: Loop condition is false.  Exiting loop
            virtio_cread_le(vdev, struct virtio_fs_config, 
num_request_queues,
            ^
    include/linux/virtio_config.h:393:2: note: expanded from macro 
'virtio_cread_le'
            do { 
     \
            ^
    fs/fuse/virtio_fs.c:693:6: note: Assuming field 'num_request_queues' 
is not equal to 0
            if (fs->num_request_queues == 0)
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    fs/fuse/virtio_fs.c:693:2: note: Taking false branch
            if (fs->num_request_queues == 0)
            ^
    fs/fuse/virtio_fs.c:698:6: note: Assuming field 'vqs' is non-null
            if (!fs->vqs)
                ^~~~~~~~
    fs/fuse/virtio_fs.c:698:2: note: Taking false branch
            if (!fs->vqs)
            ^
    fs/fuse/virtio_fs.c:705:6: note: Assuming 'vqs' is non-null
            if (!vqs || !callbacks || !names) {
                ^~~~
    fs/fuse/virtio_fs.c:705:6: note: Left side of '||' is false
    fs/fuse/virtio_fs.c:705:14: note: Assuming 'callbacks' is non-null
            if (!vqs || !callbacks || !names) {
                        ^~~~~~~~~~
    fs/fuse/virtio_fs.c:705:6: note: Left side of '||' is false
            if (!vqs || !callbacks || !names) {
                ^
    fs/fuse/virtio_fs.c:705:28: note: Assuming 'names' is non-null
            if (!vqs || !callbacks || !names) {
                                      ^~~~~~
    fs/fuse/virtio_fs.c:705:2: note: Taking false branch

vim +/newdax +471 fs/fuse/ioctl.c

72227eac177dd1 Miklos Szeredi 2021-04-08  455  72227eac177dd1 Miklos 
Szeredi 2021-04-08  456  int fuse_fileattr_set(struct user_namespace 
*mnt_userns,
72227eac177dd1 Miklos Szeredi 2021-04-08  457  		      struct dentry 
*dentry, struct fileattr *fa)
72227eac177dd1 Miklos Szeredi 2021-04-08  458  {
72227eac177dd1 Miklos Szeredi 2021-04-08  459  	struct inode *inode = 
d_inode(dentry);
72227eac177dd1 Miklos Szeredi 2021-04-08  460  	struct fuse_file *ff;
72227eac177dd1 Miklos Szeredi 2021-04-08  461  	unsigned int flags = 
fa->flags;
72227eac177dd1 Miklos Szeredi 2021-04-08  462  	struct fsxattr xfa;
a6ac625f19c4c4 Jeffle Xu      2021-07-16  463  	bool newdax;
72227eac177dd1 Miklos Szeredi 2021-04-08  464  	int err;
72227eac177dd1 Miklos Szeredi 2021-04-08  465  72227eac177dd1 Miklos 
Szeredi 2021-04-08  466  	ff = fuse_priv_ioctl_prepare(inode);
72227eac177dd1 Miklos Szeredi 2021-04-08  467  	if (IS_ERR(ff))
72227eac177dd1 Miklos Szeredi 2021-04-08  468  		return PTR_ERR(ff);
72227eac177dd1 Miklos Szeredi 2021-04-08  469  72227eac177dd1 Miklos 
Szeredi 2021-04-08  470  	if (fa->flags_valid) {
a6ac625f19c4c4 Jeffle Xu      2021-07-16 @471  		newdax = flags & FS_DAX_FL;

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org


[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34402 bytes --]

[-- Attachment #3: Attached Message Part --]
[-- Type: text/plain, Size: 150 bytes --]

_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-leave@lists.01.org


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

* Re: [PATCH v2 4/4] fuse: support changing per-file DAX flag inside guest
@ 2021-07-28  0:39   ` kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2021-07-28  0:39 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 15487 bytes --]


Hi Jeffle,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on fuse/for-next]
[also build test WARNING on v5.14-rc3 next-20210726]
[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]

url: 
https://github.com/0day-ci/linux/commits/Jeffle-Xu/virtiofs-fuse-support-per-file-DAX/20210718-102250
base: 
https://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git for-next
:::::: branch date: 10 days ago
:::::: commit date: 10 days ago
config: x86_64-randconfig-c001-20210727 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 
c658b472f3e61e1818e1909bf02f3d65470018a5)
reproduce (this is a W=1 build):
         wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross 
-O ~/bin/make.cross
         chmod +x ~/bin/make.cross
         # install x86_64 cross compiling tool for clang build
         # apt-get install binutils-x86-64-linux-gnu
         # 
https://github.com/0day-ci/linux/commit/a6ac625f19c4c4de28ee8a466c1bab8824b7042e
         git remote add linux-review https://github.com/0day-ci/linux
         git fetch --no-tags linux-review 
Jeffle-Xu/virtiofs-fuse-support-per-file-DAX/20210718-102250
         git checkout a6ac625f19c4c4de28ee8a466c1bab8824b7042e
         # save the attached .config to linux build tree
         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross 
ARCH=x86_64 clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
    drivers/regulator/qcom_spmi-regulator.c:1155:2: warning: Value 
stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
            ret = spmi_vreg_update_bits(vreg, SPMI_COMMON_REG_ENABLE,
            ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/regulator/qcom_spmi-regulator.c:1155:2: note: Value stored 
to 'ret' is never read
            ret = spmi_vreg_update_bits(vreg, SPMI_COMMON_REG_ENABLE,
            ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Suppressed 6 warnings (6 in non-user code).
    Use -header-filter=.* to display errors from all non-system headers. 
Use -system-headers to display errors from system headers as well.
    6 warnings generated.
    Suppressed 6 warnings (6 in non-user code).
    Use -header-filter=.* to display errors from all non-system headers. 
Use -system-headers to display errors from system headers as well.
    7 warnings generated.
    drivers/regulator/palmas-regulator.c:1598:36: warning: Value stored 
to 'pdata' during its initialization is never read 
[clang-analyzer-deadcode.DeadStores]
            struct palmas_pmic_platform_data *pdata = 
dev_get_platdata(&pdev->dev);
                                              ^~~~~ 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/regulator/palmas-regulator.c:1598:36: note: Value stored to 
'pdata' during its initialization is never read
            struct palmas_pmic_platform_data *pdata = 
dev_get_platdata(&pdev->dev);
                                              ^~~~~ 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Suppressed 6 warnings (6 in non-user code).
    Use -header-filter=.* to display errors from all non-system headers. 
Use -system-headers to display errors from system headers as well.
    6 warnings generated.
    Suppressed 6 warnings (6 in non-user code).
    Use -header-filter=.* to display errors from all non-system headers. 
Use -system-headers to display errors from system headers as well.
    5 warnings generated.
    Suppressed 5 warnings (5 in non-user code).
    Use -header-filter=.* to display errors from all non-system headers. 
Use -system-headers to display errors from system headers as well.
    5 warnings generated.
    Suppressed 5 warnings (5 in non-user code).
    Use -header-filter=.* to display errors from all non-system headers. 
Use -system-headers to display errors from system headers as well.
    7 warnings generated.
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:49:39: warning: 
Dereference of null pointer [clang-analyzer-core.NullDereference]
                            const struct nvkm_vmm_desc *pair = 
page[-1].desc;
                                                               ^
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1145:8: note: Assuming 
  is non-null
            if (!(*pvmm = kzalloc(sizeof(**pvmm), GFP_KERNEL)))
                  ^~~~~
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1145:2: note: Taking 
false branch
            if (!(*pvmm = kzalloc(sizeof(**pvmm), GFP_KERNEL)))
            ^
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1147:9: note: Calling 
'nvkm_vmm_ctor'
            return nvkm_vmm_ctor(func, mmu, hdr, managed, addr, size, 
key, name, *pvmm);
 
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1051:43: note: 
Assuming 'key' is null
            __mutex_init(&vmm->mutex, "&vmm->mutex", key ? key : &_key);
                                                     ^~~
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1051:43: note: '?' 
condition is false
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1056:2: note: Loop 
condition is false. Execution continues on line 1063
            while (page[1].shift)
            ^
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1063:2: note: Loop 
condition is false. Execution continues on line 1065
            for (levels = 0, desc = page->desc; desc->bits; desc++, 
levels++)
            ^
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1068:6: note: Taking 
false branch
            if (WARN_ON(levels > NVKM_VMM_LEVELS_MAX))
                ^
    include/asm-generic/bug.h:120:2: note: expanded from macro 'WARN_ON'
            if (unlikely(__ret_warn_on)) 
     \
            ^
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1068:2: note: Taking 
false branch
            if (WARN_ON(levels > NVKM_VMM_LEVELS_MAX))
            ^
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1072:41: note: Passing 
null pointer value via 3rd parameter 'page'
            vmm->pd = nvkm_vmm_pt_new(desc, false, NULL);
                                                   ^
    include/linux/stddef.h:8:14: note: expanded from macro 'NULL'
    #define NULL ((void *)0)
                 ^~~~~~~~~~~
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:1072:12: note: Calling 
'nvkm_vmm_pt_new'
            vmm->pd = nvkm_vmm_pt_new(desc, false, NULL);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:47:6: note: Assuming 
field 'type' is > PGT
            if (desc->type > PGT) {
                ^~~~~~~~~~~~~~~~
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:47:2: note: Taking 
true branch
            if (desc->type > PGT) {
            ^
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:48:7: note: Assuming 
field 'type' is equal to SPT
                    if (desc->type == SPT) {
                        ^~~~~~~~~~~~~~~~~
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:48:3: note: Taking 
true branch
                    if (desc->type == SPT) {
                    ^
    drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:49:39: note: 
Dereference of null pointer
                            const struct nvkm_vmm_desc *pair = 
page[-1].desc;
                                                               ^~~~~~~~~~~~~
    Suppressed 6 warnings (6 in non-user code).
    Use -header-filter=.* to display errors from all non-system headers. 
Use -system-headers to display errors from system headers as well.
    6 warnings generated.
    Suppressed 6 warnings (6 in non-user code).
    Use -header-filter=.* to display errors from all non-system headers. 
Use -system-headers to display errors from system headers as well.
    6 warnings generated.
    Suppressed 6 warnings (6 in non-user code).
    Use -header-filter=.* to display errors from all non-system headers. 
Use -system-headers to display errors from system headers as well.
    6 warnings generated.
    Suppressed 6 warnings (6 in non-user code).
    Use -header-filter=.* to display errors from all non-system headers. 
Use -system-headers to display errors from system headers as well.
    6 warnings generated.
    Suppressed 6 warnings (6 in non-user code).
    Use -header-filter=.* to display errors from all non-system headers. 
Use -system-headers to display errors from system headers as well.
    8 warnings generated.
>> fs/fuse/ioctl.c:471:3: warning: Value stored to 'newdax' is never read [clang-analyzer-deadcode.DeadStores]
                    newdax = flags & FS_DAX_FL;
                    ^        ~~~~~~~~~~~~~~~~~
    fs/fuse/ioctl.c:471:3: note: Value stored to 'newdax' is never read
                    newdax = flags & FS_DAX_FL;
                    ^        ~~~~~~~~~~~~~~~~~
    fs/fuse/ioctl.c:482:3: warning: Value stored to 'newdax' is never 
read [clang-analyzer-deadcode.DeadStores]
                    newdax = fa->fsx_xflags & FS_XFLAG_DAX;
                    ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    fs/fuse/ioctl.c:482:3: note: Value stored to 'newdax' is never read
                    newdax = fa->fsx_xflags & FS_XFLAG_DAX;
                    ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Suppressed 6 warnings (6 in non-user code).
    Use -header-filter=.* to display errors from all non-system headers. 
Use -system-headers to display errors from system headers as well.
    8 warnings generated.
    fs/fuse/cuse.c:359:2: warning: Value stored to 'rc' is never read 
[clang-analyzer-deadcode.DeadStores]
            rc = -ENOMEM;
            ^    ~~~~~~~
    fs/fuse/cuse.c:359:2: note: Value stored to 'rc' is never read
            rc = -ENOMEM;
            ^    ~~~~~~~
    fs/fuse/cuse.c:386:2: warning: Value stored to 'rc' is never read 
[clang-analyzer-deadcode.DeadStores]
            rc = -ENOMEM;
            ^    ~~~~~~~
    fs/fuse/cuse.c:386:2: note: Value stored to 'rc' is never read
            rc = -ENOMEM;
            ^    ~~~~~~~
    Suppressed 6 warnings (6 in non-user code).
    Use -header-filter=.* to display errors from all non-system headers. 
Use -system-headers to display errors from system headers as well.
    8 warnings generated.
    fs/fuse/virtio_fs.c:912:2: warning: Attempt to free released memory 
[clang-analyzer-unix.Malloc]
            kfree(fs->vqs);
            ^~~~~~~~~~~~~~
    fs/fuse/virtio_fs.c:879:6: note: Assuming 'fs' is non-null
            if (!fs)
                ^~~
    fs/fuse/virtio_fs.c:879:2: note: Taking false branch
            if (!fs)
            ^
    fs/fuse/virtio_fs.c:885:6: note: 'ret' is >= 0
            if (ret < 0)
                ^~~
    fs/fuse/virtio_fs.c:885:2: note: Taking false branch
            if (ret < 0)
            ^
    fs/fuse/virtio_fs.c:888:8: note: Calling 'virtio_fs_setup_vqs'
            ret = virtio_fs_setup_vqs(vdev, fs);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    fs/fuse/virtio_fs.c:691:2: note: Loop condition is false.  Exiting loop
            virtio_cread_le(vdev, struct virtio_fs_config, 
num_request_queues,
            ^
    include/linux/virtio_config.h:396:3: note: expanded from macro 
'virtio_cread_le'
                    might_sleep(); 
     \
                    ^
    include/linux/kernel.h:119:2: note: expanded from macro 'might_sleep'
            do { __might_sleep(__FILE__, __LINE__, 0); might_resched(); 
} while (0)
            ^
    fs/fuse/virtio_fs.c:691:2: note: Control jumps to 'case 4:' @line 691
            virtio_cread_le(vdev, struct virtio_fs_config, 
num_request_queues,
            ^
    include/linux/virtio_config.h:400:3: note: expanded from macro 
'virtio_cread_le'
                    switch (sizeof(virtio_cread_v)) { 
     \
                    ^
    fs/fuse/virtio_fs.c:691:2: note:  Execution continues on line 691
            virtio_cread_le(vdev, struct virtio_fs_config, 
num_request_queues,
            ^
    include/linux/virtio_config.h:408:4: note: expanded from macro 
'virtio_cread_le'
                            break; 
     \
                            ^
    fs/fuse/virtio_fs.c:691:2: note: Loop condition is false.  Exiting loop
            virtio_cread_le(vdev, struct virtio_fs_config, 
num_request_queues,
            ^
    include/linux/virtio_config.h:393:2: note: expanded from macro 
'virtio_cread_le'
            do { 
     \
            ^
    fs/fuse/virtio_fs.c:693:6: note: Assuming field 'num_request_queues' 
is not equal to 0
            if (fs->num_request_queues == 0)
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    fs/fuse/virtio_fs.c:693:2: note: Taking false branch
            if (fs->num_request_queues == 0)
            ^
    fs/fuse/virtio_fs.c:698:6: note: Assuming field 'vqs' is non-null
            if (!fs->vqs)
                ^~~~~~~~
    fs/fuse/virtio_fs.c:698:2: note: Taking false branch
            if (!fs->vqs)
            ^
    fs/fuse/virtio_fs.c:705:6: note: Assuming 'vqs' is non-null
            if (!vqs || !callbacks || !names) {
                ^~~~
    fs/fuse/virtio_fs.c:705:6: note: Left side of '||' is false
    fs/fuse/virtio_fs.c:705:14: note: Assuming 'callbacks' is non-null
            if (!vqs || !callbacks || !names) {
                        ^~~~~~~~~~
    fs/fuse/virtio_fs.c:705:6: note: Left side of '||' is false
            if (!vqs || !callbacks || !names) {
                ^
    fs/fuse/virtio_fs.c:705:28: note: Assuming 'names' is non-null
            if (!vqs || !callbacks || !names) {
                                      ^~~~~~
    fs/fuse/virtio_fs.c:705:2: note: Taking false branch

vim +/newdax +471 fs/fuse/ioctl.c

72227eac177dd1 Miklos Szeredi 2021-04-08  455  72227eac177dd1 Miklos 
Szeredi 2021-04-08  456  int fuse_fileattr_set(struct user_namespace 
*mnt_userns,
72227eac177dd1 Miklos Szeredi 2021-04-08  457  		      struct dentry 
*dentry, struct fileattr *fa)
72227eac177dd1 Miklos Szeredi 2021-04-08  458  {
72227eac177dd1 Miklos Szeredi 2021-04-08  459  	struct inode *inode = 
d_inode(dentry);
72227eac177dd1 Miklos Szeredi 2021-04-08  460  	struct fuse_file *ff;
72227eac177dd1 Miklos Szeredi 2021-04-08  461  	unsigned int flags = 
fa->flags;
72227eac177dd1 Miklos Szeredi 2021-04-08  462  	struct fsxattr xfa;
a6ac625f19c4c4 Jeffle Xu      2021-07-16  463  	bool newdax;
72227eac177dd1 Miklos Szeredi 2021-04-08  464  	int err;
72227eac177dd1 Miklos Szeredi 2021-04-08  465  72227eac177dd1 Miklos 
Szeredi 2021-04-08  466  	ff = fuse_priv_ioctl_prepare(inode);
72227eac177dd1 Miklos Szeredi 2021-04-08  467  	if (IS_ERR(ff))
72227eac177dd1 Miklos Szeredi 2021-04-08  468  		return PTR_ERR(ff);
72227eac177dd1 Miklos Szeredi 2021-04-08  469  72227eac177dd1 Miklos 
Szeredi 2021-04-08  470  	if (fa->flags_valid) {
a6ac625f19c4c4 Jeffle Xu      2021-07-16 @471  		newdax = flags & FS_DAX_FL;

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org


[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34402 bytes --]

[-- Attachment #3: AttachedMessagePart.ksh --]
[-- Type: text/plain, Size: 150 bytes --]

_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-leave@lists.01.org


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

* Re: [PATCH v2 4/4] fuse: support changing per-file DAX flag inside guest
  2021-07-16 10:47   ` Jeffle Xu
@ 2021-07-19 19:54     ` Vivek Goyal
  -1 siblings, 0 replies; 7+ messages in thread
From: Vivek Goyal @ 2021-07-19 19:54 UTC (permalink / raw)
  To: Jeffle Xu
  Cc: stefanha, miklos, linux-fsdevel, virtualization, bo.liu, joseph.qi

On Fri, Jul 16, 2021 at 06:47:53PM +0800, Jeffle Xu wrote:
> Fuse client can enable or disable per-file DAX inside guest by
> chattr(1). Similarly the new state won't be updated until the file is
> closed and reopened later.
> 
> It is worth nothing that it is a best-effort style, since whether
> per-file DAX is enabled or not is controlled by fuse_attr.flags retrieved
> by FUSE LOOKUP routine, while the algorithm constructing fuse_attr.flags
> is totally fuse server specific, not to mention ioctl may not be
> supported by fuse server at all.
> 
> Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
> ---
>  fs/fuse/ioctl.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/fuse/ioctl.c b/fs/fuse/ioctl.c
> index 546ea3d58fb4..172e05c3f038 100644
> --- a/fs/fuse/ioctl.c
> +++ b/fs/fuse/ioctl.c
> @@ -460,6 +460,7 @@ int fuse_fileattr_set(struct user_namespace *mnt_userns,
>  	struct fuse_file *ff;
>  	unsigned int flags = fa->flags;
>  	struct fsxattr xfa;
> +	bool newdax;
>  	int err;
>  
>  	ff = fuse_priv_ioctl_prepare(inode);
> @@ -467,10 +468,9 @@ int fuse_fileattr_set(struct user_namespace *mnt_userns,
>  		return PTR_ERR(ff);
>  
>  	if (fa->flags_valid) {
> +		newdax = flags & FS_DAX_FL;
>  		err = fuse_priv_ioctl(inode, ff, FS_IOC_SETFLAGS,
>  				      &flags, sizeof(flags));
> -		if (err)
> -			goto cleanup;
>  	} else {
>  		memset(&xfa, 0, sizeof(xfa));
>  		xfa.fsx_xflags = fa->fsx_xflags;
> @@ -479,11 +479,14 @@ int fuse_fileattr_set(struct user_namespace *mnt_userns,
>  		xfa.fsx_projid = fa->fsx_projid;
>  		xfa.fsx_cowextsize = fa->fsx_cowextsize;
>  
> +		newdax = fa->fsx_xflags & FS_XFLAG_DAX;
>  		err = fuse_priv_ioctl(inode, ff, FS_IOC_FSSETXATTR,
>  				      &xfa, sizeof(xfa));
>  	}
>  
> -cleanup:
> +	if (!err && IS_ENABLED(CONFIG_FUSE_DAX))
> +		fuse_dax_dontcache(inode, newdax);

This assumes that server will set ATTR_DAX flag for inode based on
whether inode has FS_DAX_FL set or not.

So that means server first will have to know that client has DAX enabled
so that it can query FS_DAX_FL. And in current framework we don't have
a way for server to know if client is using DAX or not.

I think there is little disconnect here. So either client should be
checking FS_DAX_FL flag on inode. But we probably don't want to pay
extra round trip cost for this. 

That means somehow server should return this information as part of
inode attrs only if client wants this extra file attr informaiton. So
may be GETATTR should be enhanced instead to return file attr information
too if client asked for it?

I have not looked what it takes to implement this. If this is too 
complicated, then alternate approach will be that it is up to the
server to decide what inodes should use DAX and there is no guarantee
that server will make sue of FS_DAX_FL flag. fuse will still support
setting FS_DAX_FL but server could choose to not use it at all. In
that case fuse client will not have to query file attrs in GETATTR
and just rely on ATTR_DAX flag set by server. I think that's what
you are implementing.  If that's the case then dontcache does not make
much sense because you don't even know if server is looking at
FS_DAX_FL to decide whether DAX should be used or not.

Thanks
Vivek

> +
>  	fuse_priv_ioctl_cleanup(inode, ff);
>  
>  	return err;
> -- 
> 2.27.0
> 


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

* Re: [PATCH v2 4/4] fuse: support changing per-file DAX flag inside guest
@ 2021-07-19 19:54     ` Vivek Goyal
  0 siblings, 0 replies; 7+ messages in thread
From: Vivek Goyal @ 2021-07-19 19:54 UTC (permalink / raw)
  To: Jeffle Xu
  Cc: miklos, virtualization, joseph.qi, bo.liu, stefanha, linux-fsdevel

On Fri, Jul 16, 2021 at 06:47:53PM +0800, Jeffle Xu wrote:
> Fuse client can enable or disable per-file DAX inside guest by
> chattr(1). Similarly the new state won't be updated until the file is
> closed and reopened later.
> 
> It is worth nothing that it is a best-effort style, since whether
> per-file DAX is enabled or not is controlled by fuse_attr.flags retrieved
> by FUSE LOOKUP routine, while the algorithm constructing fuse_attr.flags
> is totally fuse server specific, not to mention ioctl may not be
> supported by fuse server at all.
> 
> Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
> ---
>  fs/fuse/ioctl.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/fuse/ioctl.c b/fs/fuse/ioctl.c
> index 546ea3d58fb4..172e05c3f038 100644
> --- a/fs/fuse/ioctl.c
> +++ b/fs/fuse/ioctl.c
> @@ -460,6 +460,7 @@ int fuse_fileattr_set(struct user_namespace *mnt_userns,
>  	struct fuse_file *ff;
>  	unsigned int flags = fa->flags;
>  	struct fsxattr xfa;
> +	bool newdax;
>  	int err;
>  
>  	ff = fuse_priv_ioctl_prepare(inode);
> @@ -467,10 +468,9 @@ int fuse_fileattr_set(struct user_namespace *mnt_userns,
>  		return PTR_ERR(ff);
>  
>  	if (fa->flags_valid) {
> +		newdax = flags & FS_DAX_FL;
>  		err = fuse_priv_ioctl(inode, ff, FS_IOC_SETFLAGS,
>  				      &flags, sizeof(flags));
> -		if (err)
> -			goto cleanup;
>  	} else {
>  		memset(&xfa, 0, sizeof(xfa));
>  		xfa.fsx_xflags = fa->fsx_xflags;
> @@ -479,11 +479,14 @@ int fuse_fileattr_set(struct user_namespace *mnt_userns,
>  		xfa.fsx_projid = fa->fsx_projid;
>  		xfa.fsx_cowextsize = fa->fsx_cowextsize;
>  
> +		newdax = fa->fsx_xflags & FS_XFLAG_DAX;
>  		err = fuse_priv_ioctl(inode, ff, FS_IOC_FSSETXATTR,
>  				      &xfa, sizeof(xfa));
>  	}
>  
> -cleanup:
> +	if (!err && IS_ENABLED(CONFIG_FUSE_DAX))
> +		fuse_dax_dontcache(inode, newdax);

This assumes that server will set ATTR_DAX flag for inode based on
whether inode has FS_DAX_FL set or not.

So that means server first will have to know that client has DAX enabled
so that it can query FS_DAX_FL. And in current framework we don't have
a way for server to know if client is using DAX or not.

I think there is little disconnect here. So either client should be
checking FS_DAX_FL flag on inode. But we probably don't want to pay
extra round trip cost for this. 

That means somehow server should return this information as part of
inode attrs only if client wants this extra file attr informaiton. So
may be GETATTR should be enhanced instead to return file attr information
too if client asked for it?

I have not looked what it takes to implement this. If this is too 
complicated, then alternate approach will be that it is up to the
server to decide what inodes should use DAX and there is no guarantee
that server will make sue of FS_DAX_FL flag. fuse will still support
setting FS_DAX_FL but server could choose to not use it at all. In
that case fuse client will not have to query file attrs in GETATTR
and just rely on ATTR_DAX flag set by server. I think that's what
you are implementing.  If that's the case then dontcache does not make
much sense because you don't even know if server is looking at
FS_DAX_FL to decide whether DAX should be used or not.

Thanks
Vivek

> +
>  	fuse_priv_ioctl_cleanup(inode, ff);
>  
>  	return err;
> -- 
> 2.27.0
> 

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

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

* [PATCH v2 4/4] fuse: support changing per-file DAX flag inside guest
  2021-07-16 10:47 [PATCH v2 0/4] virtiofs,fuse: support per-file DAX Jeffle Xu
@ 2021-07-16 10:47   ` Jeffle Xu
  0 siblings, 0 replies; 7+ messages in thread
From: Jeffle Xu @ 2021-07-16 10:47 UTC (permalink / raw)
  To: vgoyal, stefanha, miklos; +Cc: linux-fsdevel, virtualization, bo.liu, joseph.qi

Fuse client can enable or disable per-file DAX inside guest by
chattr(1). Similarly the new state won't be updated until the file is
closed and reopened later.

It is worth nothing that it is a best-effort style, since whether
per-file DAX is enabled or not is controlled by fuse_attr.flags retrieved
by FUSE LOOKUP routine, while the algorithm constructing fuse_attr.flags
is totally fuse server specific, not to mention ioctl may not be
supported by fuse server at all.

Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
---
 fs/fuse/ioctl.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/fs/fuse/ioctl.c b/fs/fuse/ioctl.c
index 546ea3d58fb4..172e05c3f038 100644
--- a/fs/fuse/ioctl.c
+++ b/fs/fuse/ioctl.c
@@ -460,6 +460,7 @@ int fuse_fileattr_set(struct user_namespace *mnt_userns,
 	struct fuse_file *ff;
 	unsigned int flags = fa->flags;
 	struct fsxattr xfa;
+	bool newdax;
 	int err;
 
 	ff = fuse_priv_ioctl_prepare(inode);
@@ -467,10 +468,9 @@ int fuse_fileattr_set(struct user_namespace *mnt_userns,
 		return PTR_ERR(ff);
 
 	if (fa->flags_valid) {
+		newdax = flags & FS_DAX_FL;
 		err = fuse_priv_ioctl(inode, ff, FS_IOC_SETFLAGS,
 				      &flags, sizeof(flags));
-		if (err)
-			goto cleanup;
 	} else {
 		memset(&xfa, 0, sizeof(xfa));
 		xfa.fsx_xflags = fa->fsx_xflags;
@@ -479,11 +479,14 @@ int fuse_fileattr_set(struct user_namespace *mnt_userns,
 		xfa.fsx_projid = fa->fsx_projid;
 		xfa.fsx_cowextsize = fa->fsx_cowextsize;
 
+		newdax = fa->fsx_xflags & FS_XFLAG_DAX;
 		err = fuse_priv_ioctl(inode, ff, FS_IOC_FSSETXATTR,
 				      &xfa, sizeof(xfa));
 	}
 
-cleanup:
+	if (!err && IS_ENABLED(CONFIG_FUSE_DAX))
+		fuse_dax_dontcache(inode, newdax);
+
 	fuse_priv_ioctl_cleanup(inode, ff);
 
 	return err;
-- 
2.27.0


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

* [PATCH v2 4/4] fuse: support changing per-file DAX flag inside guest
@ 2021-07-16 10:47   ` Jeffle Xu
  0 siblings, 0 replies; 7+ messages in thread
From: Jeffle Xu @ 2021-07-16 10:47 UTC (permalink / raw)
  To: vgoyal, stefanha, miklos; +Cc: linux-fsdevel, joseph.qi, bo.liu, virtualization

Fuse client can enable or disable per-file DAX inside guest by
chattr(1). Similarly the new state won't be updated until the file is
closed and reopened later.

It is worth nothing that it is a best-effort style, since whether
per-file DAX is enabled or not is controlled by fuse_attr.flags retrieved
by FUSE LOOKUP routine, while the algorithm constructing fuse_attr.flags
is totally fuse server specific, not to mention ioctl may not be
supported by fuse server at all.

Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
---
 fs/fuse/ioctl.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/fs/fuse/ioctl.c b/fs/fuse/ioctl.c
index 546ea3d58fb4..172e05c3f038 100644
--- a/fs/fuse/ioctl.c
+++ b/fs/fuse/ioctl.c
@@ -460,6 +460,7 @@ int fuse_fileattr_set(struct user_namespace *mnt_userns,
 	struct fuse_file *ff;
 	unsigned int flags = fa->flags;
 	struct fsxattr xfa;
+	bool newdax;
 	int err;
 
 	ff = fuse_priv_ioctl_prepare(inode);
@@ -467,10 +468,9 @@ int fuse_fileattr_set(struct user_namespace *mnt_userns,
 		return PTR_ERR(ff);
 
 	if (fa->flags_valid) {
+		newdax = flags & FS_DAX_FL;
 		err = fuse_priv_ioctl(inode, ff, FS_IOC_SETFLAGS,
 				      &flags, sizeof(flags));
-		if (err)
-			goto cleanup;
 	} else {
 		memset(&xfa, 0, sizeof(xfa));
 		xfa.fsx_xflags = fa->fsx_xflags;
@@ -479,11 +479,14 @@ int fuse_fileattr_set(struct user_namespace *mnt_userns,
 		xfa.fsx_projid = fa->fsx_projid;
 		xfa.fsx_cowextsize = fa->fsx_cowextsize;
 
+		newdax = fa->fsx_xflags & FS_XFLAG_DAX;
 		err = fuse_priv_ioctl(inode, ff, FS_IOC_FSSETXATTR,
 				      &xfa, sizeof(xfa));
 	}
 
-cleanup:
+	if (!err && IS_ENABLED(CONFIG_FUSE_DAX))
+		fuse_dax_dontcache(inode, newdax);
+
 	fuse_priv_ioctl_cleanup(inode, ff);
 
 	return err;
-- 
2.27.0

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

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

end of thread, other threads:[~2021-07-28  0:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-27 18:31 [PATCH v2 4/4] fuse: support changing per-file DAX flag inside guest kernel test robot
2021-07-28  0:39 ` kernel test robot
2021-07-28  0:39   ` kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2021-07-16 10:47 [PATCH v2 0/4] virtiofs,fuse: support per-file DAX Jeffle Xu
2021-07-16 10:47 ` [PATCH v2 4/4] fuse: support changing per-file DAX flag inside guest Jeffle Xu
2021-07-16 10:47   ` Jeffle Xu
2021-07-19 19:54   ` Vivek Goyal
2021-07-19 19:54     ` Vivek Goyal

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.