All of lore.kernel.org
 help / color / mirror / Atom feed
* [jlayton:mgctime 50/118] fs/hostfs/hostfs_kern.c:520:36: error: incompatible type for argument 2 of 'inode_set_ctime_to_ts'
@ 2023-07-11 18:30 kernel test robot
  2023-07-12 10:08 ` Christian Brauner
  0 siblings, 1 reply; 5+ messages in thread
From: kernel test robot @ 2023-07-11 18:30 UTC (permalink / raw)
  To: Jeff Layton; +Cc: oe-kbuild-all, Christian Brauner, Jan Kara

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git mgctime
head:   61142a4e29e09f59b3b640f0f691e00af4c4a6f9
commit: 2ceaa835b4f50d1b0c0fa678f352bb4f6f5f8062 [50/118] hostfs: convert to ctime accessor functions
config: um-defconfig (https://download.01.org/0day-ci/archive/20230712/202307120235.UI0A6Op0-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230712/202307120235.UI0A6Op0-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/202307120235.UI0A6Op0-lkp@intel.com/

All errors (new ones prefixed by >>):

   fs/hostfs/hostfs_kern.c: In function 'hostfs_inode_update':
>> fs/hostfs/hostfs_kern.c:520:36: error: incompatible type for argument 2 of 'inode_set_ctime_to_ts'
     520 |         inode_set_ctime_to_ts(ino, &st->ctime);
         |                                    ^~~~~~~~~~
         |                                    |
         |                                    const struct hostfs_timespec *
   In file included from fs/hostfs/hostfs_kern.c:9:
   include/linux/fs.h:1499:73: note: expected 'struct timespec64' but argument is of type 'const struct hostfs_timespec *'
    1499 |                                                       struct timespec64 ts)
         |                                                       ~~~~~~~~~~~~~~~~~~^~


vim +/inode_set_ctime_to_ts +520 fs/hostfs/hostfs_kern.c

   510	
   511	static int hostfs_inode_update(struct inode *ino, const struct hostfs_stat *st)
   512	{
   513		set_nlink(ino, st->nlink);
   514		i_uid_write(ino, st->uid);
   515		i_gid_write(ino, st->gid);
   516		ino->i_atime =
   517			(struct timespec64){ st->atime.tv_sec, st->atime.tv_nsec };
   518		ino->i_mtime =
   519			(struct timespec64){ st->mtime.tv_sec, st->mtime.tv_nsec };
 > 520		inode_set_ctime_to_ts(ino, &st->ctime);
   521		ino->i_size = st->size;
   522		ino->i_blocks = st->blocks;
   523		return 0;
   524	}
   525	

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

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

* Re: [jlayton:mgctime 50/118] fs/hostfs/hostfs_kern.c:520:36: error: incompatible type for argument 2 of 'inode_set_ctime_to_ts'
  2023-07-11 18:30 [jlayton:mgctime 50/118] fs/hostfs/hostfs_kern.c:520:36: error: incompatible type for argument 2 of 'inode_set_ctime_to_ts' kernel test robot
@ 2023-07-12 10:08 ` Christian Brauner
  2023-07-12 10:18   ` Jeff Layton
  0 siblings, 1 reply; 5+ messages in thread
From: Christian Brauner @ 2023-07-12 10:08 UTC (permalink / raw)
  To: Jeff Layton; +Cc: kernel test robot, oe-kbuild-all, Jan Kara

On Wed, Jul 12, 2023 at 02:30:10AM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git mgctime
> head:   61142a4e29e09f59b3b640f0f691e00af4c4a6f9
> commit: 2ceaa835b4f50d1b0c0fa678f352bb4f6f5f8062 [50/118] hostfs: convert to ctime accessor functions
> config: um-defconfig (https://download.01.org/0day-ci/archive/20230712/202307120235.UI0A6Op0-lkp@intel.com/config)
> compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
> reproduce: (https://download.01.org/0day-ci/archive/20230712/202307120235.UI0A6Op0-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/202307120235.UI0A6Op0-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
>    fs/hostfs/hostfs_kern.c: In function 'hostfs_inode_update':
> >> fs/hostfs/hostfs_kern.c:520:36: error: incompatible type for argument 2 of 'inode_set_ctime_to_ts'
>      520 |         inode_set_ctime_to_ts(ino, &st->ctime);
>          |                                    ^~~~~~~~~~
>          |                                    |
>          |                                    const struct hostfs_timespec *
>    In file included from fs/hostfs/hostfs_kern.c:9:
>    include/linux/fs.h:1499:73: note: expected 'struct timespec64' but argument is of type 'const struct hostfs_timespec *'
>     1499 |                                                       struct timespec64 ts)
>          |                                                       ~~~~~~~~~~~~~~~~~~^~

This bug is also present in the patches I applied. I've fixed it up the
following way:

diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index 182af84a9c12..1f24ed13cf40 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -517,7 +517,8 @@ static int hostfs_inode_update(struct inode *ino, const struct hostfs_stat *st)
                (struct timespec64){ st->atime.tv_sec, st->atime.tv_nsec };
        ino->i_mtime =
                (struct timespec64){ st->mtime.tv_sec, st->mtime.tv_nsec };
-       inode_set_ctime_to_ts(ino, &st->ctime);
+       inode_set_ctime_to_ts(ino, (struct timespec64){ st->ctime.tv_sec,
+                                                       st->ctime.tv_nsec });
        ino->i_size = st->size;
        ino->i_blocks = st->blocks;
        return 0;

Let me know if that's wrong.

> 
> 
> vim +/inode_set_ctime_to_ts +520 fs/hostfs/hostfs_kern.c
> 
>    510	
>    511	static int hostfs_inode_update(struct inode *ino, const struct hostfs_stat *st)
>    512	{
>    513		set_nlink(ino, st->nlink);
>    514		i_uid_write(ino, st->uid);
>    515		i_gid_write(ino, st->gid);
>    516		ino->i_atime =
>    517			(struct timespec64){ st->atime.tv_sec, st->atime.tv_nsec };
>    518		ino->i_mtime =
>    519			(struct timespec64){ st->mtime.tv_sec, st->mtime.tv_nsec };
>  > 520		inode_set_ctime_to_ts(ino, &st->ctime);
>    521		ino->i_size = st->size;
>    522		ino->i_blocks = st->blocks;
>    523		return 0;
>    524	}
>    525	
> 
> -- 
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki

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

* Re: [jlayton:mgctime 50/118] fs/hostfs/hostfs_kern.c:520:36: error: incompatible type for argument 2 of 'inode_set_ctime_to_ts'
  2023-07-12 10:08 ` Christian Brauner
@ 2023-07-12 10:18   ` Jeff Layton
  2023-07-12 10:35     ` Jeff Layton
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Layton @ 2023-07-12 10:18 UTC (permalink / raw)
  To: Christian Brauner; +Cc: kernel test robot, oe-kbuild-all, Jan Kara

On Wed, 2023-07-12 at 12:08 +0200, Christian Brauner wrote:
> On Wed, Jul 12, 2023 at 02:30:10AM +0800, kernel test robot wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git mgctime
> > head:   61142a4e29e09f59b3b640f0f691e00af4c4a6f9
> > commit: 2ceaa835b4f50d1b0c0fa678f352bb4f6f5f8062 [50/118] hostfs: convert to ctime accessor functions
> > config: um-defconfig (https://download.01.org/0day-ci/archive/20230712/202307120235.UI0A6Op0-lkp@intel.com/config)
> > compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
> > reproduce: (https://download.01.org/0day-ci/archive/20230712/202307120235.UI0A6Op0-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/202307120235.UI0A6Op0-lkp@intel.com/
> > 
> > All errors (new ones prefixed by >>):
> > 
> >    fs/hostfs/hostfs_kern.c: In function 'hostfs_inode_update':
> > > > fs/hostfs/hostfs_kern.c:520:36: error: incompatible type for argument 2 of 'inode_set_ctime_to_ts'
> >      520 |         inode_set_ctime_to_ts(ino, &st->ctime);
> >          |                                    ^~~~~~~~~~
> >          |                                    |
> >          |                                    const struct hostfs_timespec *
> >    In file included from fs/hostfs/hostfs_kern.c:9:
> >    include/linux/fs.h:1499:73: note: expected 'struct timespec64' but argument is of type 'const struct hostfs_timespec *'
> >     1499 |                                                       struct timespec64 ts)
> >          |                                                       ~~~~~~~~~~~~~~~~~~^~
> 
> This bug is also present in the patches I applied. I've fixed it up the
> following way:
> 
> diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
> index 182af84a9c12..1f24ed13cf40 100644
> --- a/fs/hostfs/hostfs_kern.c
> +++ b/fs/hostfs/hostfs_kern.c
> @@ -517,7 +517,8 @@ static int hostfs_inode_update(struct inode *ino, const struct hostfs_stat *st)
>                 (struct timespec64){ st->atime.tv_sec, st->atime.tv_nsec };
>         ino->i_mtime =
>                 (struct timespec64){ st->mtime.tv_sec, st->mtime.tv_nsec };
> -       inode_set_ctime_to_ts(ino, &st->ctime);
> +       inode_set_ctime_to_ts(ino, (struct timespec64){ st->ctime.tv_sec,
> +                                                       st->ctime.tv_nsec });
>         ino->i_size = st->size;
>         ino->i_blocks = st->blocks;
>         return 0;
> 
> Let me know if that's wrong.
> 

That should work, but it's not quite as clean looking as:

    inode_set_ctime(ino, st->ctime.tv_sec, st->ctime.tv_nsec);

I'm having trouble build testing this though as I don't have a config
that enables CONFIG_HOSTFS, and I'm not quite sure how to get there.

> > 
> > 
> > vim +/inode_set_ctime_to_ts +520 fs/hostfs/hostfs_kern.c
> > 
> >    510	
> >    511	static int hostfs_inode_update(struct inode *ino, const struct hostfs_stat *st)
> >    512	{
> >    513		set_nlink(ino, st->nlink);
> >    514		i_uid_write(ino, st->uid);
> >    515		i_gid_write(ino, st->gid);
> >    516		ino->i_atime =
> >    517			(struct timespec64){ st->atime.tv_sec, st->atime.tv_nsec };
> >    518		ino->i_mtime =
> >    519			(struct timespec64){ st->mtime.tv_sec, st->mtime.tv_nsec };
> >  > 520		inode_set_ctime_to_ts(ino, &st->ctime);
> >    521		ino->i_size = st->size;
> >    522		ino->i_blocks = st->blocks;
> >    523		return 0;
> >    524	}
> >    525	
> > 
> > -- 
> > 0-DAY CI Kernel Test Service
> > https://github.com/intel/lkp-tests/wiki

-- 
Jeff Layton <jlayton@kernel.org>

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

* Re: [jlayton:mgctime 50/118] fs/hostfs/hostfs_kern.c:520:36: error: incompatible type for argument 2 of 'inode_set_ctime_to_ts'
  2023-07-12 10:18   ` Jeff Layton
@ 2023-07-12 10:35     ` Jeff Layton
  2023-07-12 11:10       ` Christian Brauner
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Layton @ 2023-07-12 10:35 UTC (permalink / raw)
  To: Christian Brauner; +Cc: kernel test robot, oe-kbuild-all, Jan Kara

On Wed, 2023-07-12 at 06:18 -0400, Jeff Layton wrote:
> On Wed, 2023-07-12 at 12:08 +0200, Christian Brauner wrote:
> > On Wed, Jul 12, 2023 at 02:30:10AM +0800, kernel test robot wrote:
> > > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git mgctime
> > > head:   61142a4e29e09f59b3b640f0f691e00af4c4a6f9
> > > commit: 2ceaa835b4f50d1b0c0fa678f352bb4f6f5f8062 [50/118] hostfs: convert to ctime accessor functions
> > > config: um-defconfig (https://download.01.org/0day-ci/archive/20230712/202307120235.UI0A6Op0-lkp@intel.com/config)
> > > compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
> > > reproduce: (https://download.01.org/0day-ci/archive/20230712/202307120235.UI0A6Op0-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/202307120235.UI0A6Op0-lkp@intel.com/
> > > 
> > > All errors (new ones prefixed by >>):
> > > 
> > >    fs/hostfs/hostfs_kern.c: In function 'hostfs_inode_update':
> > > > > fs/hostfs/hostfs_kern.c:520:36: error: incompatible type for argument 2 of 'inode_set_ctime_to_ts'
> > >      520 |         inode_set_ctime_to_ts(ino, &st->ctime);
> > >          |                                    ^~~~~~~~~~
> > >          |                                    |
> > >          |                                    const struct hostfs_timespec *
> > >    In file included from fs/hostfs/hostfs_kern.c:9:
> > >    include/linux/fs.h:1499:73: note: expected 'struct timespec64' but argument is of type 'const struct hostfs_timespec *'
> > >     1499 |                                                       struct timespec64 ts)
> > >          |                                                       ~~~~~~~~~~~~~~~~~~^~
> > 
> > This bug is also present in the patches I applied. I've fixed it up the
> > following way:
> > 
> > diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
> > index 182af84a9c12..1f24ed13cf40 100644
> > --- a/fs/hostfs/hostfs_kern.c
> > +++ b/fs/hostfs/hostfs_kern.c
> > @@ -517,7 +517,8 @@ static int hostfs_inode_update(struct inode *ino, const struct hostfs_stat *st)
> >                 (struct timespec64){ st->atime.tv_sec, st->atime.tv_nsec };
> >         ino->i_mtime =
> >                 (struct timespec64){ st->mtime.tv_sec, st->mtime.tv_nsec };
> > -       inode_set_ctime_to_ts(ino, &st->ctime);
> > +       inode_set_ctime_to_ts(ino, (struct timespec64){ st->ctime.tv_sec,
> > +                                                       st->ctime.tv_nsec });
> >         ino->i_size = st->size;
> >         ino->i_blocks = st->blocks;
> >         return 0;
> > 
> > Let me know if that's wrong.
> > 
> 
> That should work, but it's not quite as clean looking as:
> 
>     inode_set_ctime(ino, st->ctime.tv_sec, st->ctime.tv_nsec);
> 
> I'm having trouble build testing this though as I don't have a config
> that enables CONFIG_HOSTFS, and I'm not quite sure how to get there.


Yeah, I'm not sure what I'm doing wrong, but when I take the config file
associated with this bug report and run it through make oldconfig,
CONFIG_HOSTFS ends up being disabled. I've not been able to test this
properly.

Is there some trick to building a proper UML kernel these days?
-- 
Jeff Layton <jlayton@kernel.org>

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

* Re: [jlayton:mgctime 50/118] fs/hostfs/hostfs_kern.c:520:36: error: incompatible type for argument 2 of 'inode_set_ctime_to_ts'
  2023-07-12 10:35     ` Jeff Layton
@ 2023-07-12 11:10       ` Christian Brauner
  0 siblings, 0 replies; 5+ messages in thread
From: Christian Brauner @ 2023-07-12 11:10 UTC (permalink / raw)
  To: Jeff Layton; +Cc: kernel test robot, oe-kbuild-all, Jan Kara

On Wed, Jul 12, 2023 at 06:35:08AM -0400, Jeff Layton wrote:
> On Wed, 2023-07-12 at 06:18 -0400, Jeff Layton wrote:
> > On Wed, 2023-07-12 at 12:08 +0200, Christian Brauner wrote:
> > > On Wed, Jul 12, 2023 at 02:30:10AM +0800, kernel test robot wrote:
> > > > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git mgctime
> > > > head:   61142a4e29e09f59b3b640f0f691e00af4c4a6f9
> > > > commit: 2ceaa835b4f50d1b0c0fa678f352bb4f6f5f8062 [50/118] hostfs: convert to ctime accessor functions
> > > > config: um-defconfig (https://download.01.org/0day-ci/archive/20230712/202307120235.UI0A6Op0-lkp@intel.com/config)
> > > > compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
> > > > reproduce: (https://download.01.org/0day-ci/archive/20230712/202307120235.UI0A6Op0-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/202307120235.UI0A6Op0-lkp@intel.com/
> > > > 
> > > > All errors (new ones prefixed by >>):
> > > > 
> > > >    fs/hostfs/hostfs_kern.c: In function 'hostfs_inode_update':
> > > > > > fs/hostfs/hostfs_kern.c:520:36: error: incompatible type for argument 2 of 'inode_set_ctime_to_ts'
> > > >      520 |         inode_set_ctime_to_ts(ino, &st->ctime);
> > > >          |                                    ^~~~~~~~~~
> > > >          |                                    |
> > > >          |                                    const struct hostfs_timespec *
> > > >    In file included from fs/hostfs/hostfs_kern.c:9:
> > > >    include/linux/fs.h:1499:73: note: expected 'struct timespec64' but argument is of type 'const struct hostfs_timespec *'
> > > >     1499 |                                                       struct timespec64 ts)
> > > >          |                                                       ~~~~~~~~~~~~~~~~~~^~
> > > 
> > > This bug is also present in the patches I applied. I've fixed it up the
> > > following way:
> > > 
> > > diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
> > > index 182af84a9c12..1f24ed13cf40 100644
> > > --- a/fs/hostfs/hostfs_kern.c
> > > +++ b/fs/hostfs/hostfs_kern.c
> > > @@ -517,7 +517,8 @@ static int hostfs_inode_update(struct inode *ino, const struct hostfs_stat *st)
> > >                 (struct timespec64){ st->atime.tv_sec, st->atime.tv_nsec };
> > >         ino->i_mtime =
> > >                 (struct timespec64){ st->mtime.tv_sec, st->mtime.tv_nsec };
> > > -       inode_set_ctime_to_ts(ino, &st->ctime);
> > > +       inode_set_ctime_to_ts(ino, (struct timespec64){ st->ctime.tv_sec,
> > > +                                                       st->ctime.tv_nsec });
> > >         ino->i_size = st->size;
> > >         ino->i_blocks = st->blocks;
> > >         return 0;
> > > 
> > > Let me know if that's wrong.
> > > 
> > 
> > That should work, but it's not quite as clean looking as:
> > 
> >     inode_set_ctime(ino, st->ctime.tv_sec, st->ctime.tv_nsec);
> > 
> > I'm having trouble build testing this though as I don't have a config
> > that enables CONFIG_HOSTFS, and I'm not quite sure how to get there.
> 
> 
> Yeah, I'm not sure what I'm doing wrong, but when I take the config file
> associated with this bug report and run it through make oldconfig,
> CONFIG_HOSTFS ends up being disabled. I've not been able to test this
> properly.
> 
> Is there some trick to building a proper UML kernel these days?

So what I end up doing is:

cd kernel-repo/
mkdir build
cp /boot/$config build/.config
make ARCH=um O=build.v1/ fs/hostfs/hostfs_kern.o

that should be enough to test whether this compiles. With your change
applied:

> make -j7 ARCH=um O=build.v1/ fs/hostfs/hostfs_kern.o
  GEN     Makefile
  DESCEND bpf/resolve_btfids
  INSTALL libsubcmd_headers
  CALL    ../scripts/checksyscalls.sh
  CC      fs/hostfs/hostfs_kern.o

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

end of thread, other threads:[~2023-07-12 11:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-11 18:30 [jlayton:mgctime 50/118] fs/hostfs/hostfs_kern.c:520:36: error: incompatible type for argument 2 of 'inode_set_ctime_to_ts' kernel test robot
2023-07-12 10:08 ` Christian Brauner
2023-07-12 10:18   ` Jeff Layton
2023-07-12 10:35     ` Jeff Layton
2023-07-12 11:10       ` Christian Brauner

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.