Thanks for your attention, I have solved the warnings in the following
patch (the similar title: hostfs: convert hostfs to use the new mount API):
https://lore.kernel.org/all/20240515025536.3667017-1-lihongbo22@xxxxxxxxxx/
or
https://patchwork.ozlabs.org/project/linux-um/patch/20240515025536.3667017-1-lihongbo22@xxxxxxxxxx/
It was strange that the kernel test robot did not send the results on
the new patch.
Thanks,
Hongbo
On 2024/5/17 19:01, Dan Carpenter wrote:
Hi Hongbo,
kernel test robot noticed the following build warnings:
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Hongbo-Li/hostfs-convert-hostfs-to-use-the-new-mount-api/20240513-204233
base: git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux next
patch link: https://lore.kernel.org/r/20240513124141.3788846-1-lihongbo22%40huawei.com
patch subject: [PATCH] hostfs: convert hostfs to use the new mount api
config: um-randconfig-r081-20240517 (https://download.01.org/0day-ci/archive/20240517/202405171154.21q42SWy-lkp@xxxxxxxxx/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project d3455f4ddd16811401fa153298fadd2f59f6914e)
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@xxxxxxxxx>
| Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
| Closes: https://lore.kernel.org/r/202405171154.21q42SWy-lkp@xxxxxxxxx/
smatch warnings:
fs/hostfs/hostfs_kern.c:960 hostfs_fill_super() error: uninitialized symbol 'host_root'.
vim +/host_root +960 fs/hostfs/hostfs_kern.c
2c2593890079e8 Hongbo Li 2024-05-13 938 static int hostfs_fill_super(struct super_block *sb, struct fs_context *fc)
^1da177e4c3f41 Linus Torvalds 2005-04-16 939 {
2c2593890079e8 Hongbo Li 2024-05-13 940 struct hostfs_fs_info *fsi = sb->s_fs_info;
^1da177e4c3f41 Linus Torvalds 2005-04-16 941 struct inode *root_inode;
2c2593890079e8 Hongbo Li 2024-05-13 942 char *host_root;
^1da177e4c3f41 Linus Torvalds 2005-04-16 943 int err;
^1da177e4c3f41 Linus Torvalds 2005-04-16 944
^1da177e4c3f41 Linus Torvalds 2005-04-16 945 sb->s_blocksize = 1024;
^1da177e4c3f41 Linus Torvalds 2005-04-16 946 sb->s_blocksize_bits = 10;
^1da177e4c3f41 Linus Torvalds 2005-04-16 947 sb->s_magic = HOSTFS_SUPER_MAGIC;
^1da177e4c3f41 Linus Torvalds 2005-04-16 948 sb->s_op = &hostfs_sbops;
b26d4cd385fc51 Al Viro 2013-10-25 949 sb->s_d_op = &simple_dentry_operations;
752fa51e4c5182 Wolfgang Illmeyer 2009-06-30 950 sb->s_maxbytes = MAX_LFS_FILESIZE;
ce72750f04d68a Sjoerd Simons 2021-11-05 951 err = super_setup_bdi(sb);
ce72750f04d68a Sjoerd Simons 2021-11-05 952 if (err)
74ce793bcbde5c Mickaël Salaün 2023-06-12 953 return err;
^1da177e4c3f41 Linus Torvalds 2005-04-16 954
b58c4e96192ee7 Andy Shevchenko 2020-03-20 955 /* NULL is printed as '(null)' by printf(): avoid that. */
2c2593890079e8 Hongbo Li 2024-05-13 956 if (fc->source == NULL)
2c2593890079e8 Hongbo Li 2024-05-13 957 host_root = "";
Uninitialized on else path
^1da177e4c3f41 Linus Torvalds 2005-04-16 958
2c2593890079e8 Hongbo Li 2024-05-13 959 fsi->host_root_path =
2c2593890079e8 Hongbo Li 2024-05-13 @960 kasprintf(GFP_KERNEL, "%s/%s", root_ino, host_root);
^^^^^^^^^
2c2593890079e8 Hongbo Li 2024-05-13 961 if (fsi->host_root_path == NULL)
74ce793bcbde5c Mickaël Salaün 2023-06-12 962 return -ENOMEM;