linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] jffs2: use 64-bit intermediate timestamps
@ 2018-06-19 15:59 Arnd Bergmann
  2018-06-19 15:59 ` [PATCH 2/2] jffs2: use unsigned 32-bit timstamps consistently Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2018-06-19 15:59 UTC (permalink / raw)
  To: David Woodhouse
  Cc: Arnd Bergmann, Andreas Dilger, Deepa Dinamani, Al Viro,
	linux-mtd, linux-kernel

The VFS now uses timespec64 timestamps consistently, but jffs2 still
converts them to 32-bit numbers on the storage medium. As the helper
functions for the conversion (get_seconds() and timespec_to_timespec64())
are now deprecated, let's change them over to the more modern
replacements.

This keeps the traditional interpretation of those values, where
the on-disk 32-bit numbers are taken to be negative numbers, i.e.
dates before 1970, on 32-bit machines, but future numbers past 2038
on 64-bit machines.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/jffs2/dir.c      | 32 ++++++++++++++++----------------
 fs/jffs2/file.c     |  6 +++---
 fs/jffs2/fs.c       | 12 ++++++------
 fs/jffs2/os-linux.h |  3 ++-
 4 files changed, 27 insertions(+), 26 deletions(-)

diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c
index b2944f9218f7..f20cff1194bb 100644
--- a/fs/jffs2/dir.c
+++ b/fs/jffs2/dir.c
@@ -201,7 +201,7 @@ static int jffs2_create(struct inode *dir_i, struct dentry *dentry,
 	if (ret)
 		goto fail;
 
-	dir_i->i_mtime = dir_i->i_ctime = timespec_to_timespec64(ITIME(je32_to_cpu(ri->ctime)));
+	dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(ri->ctime));
 
 	jffs2_free_raw_inode(ri);
 
@@ -227,14 +227,14 @@ static int jffs2_unlink(struct inode *dir_i, struct dentry *dentry)
 	struct jffs2_inode_info *dir_f = JFFS2_INODE_INFO(dir_i);
 	struct jffs2_inode_info *dead_f = JFFS2_INODE_INFO(d_inode(dentry));
 	int ret;
-	uint32_t now = get_seconds();
+	uint32_t now = JFFS2_NOW();
 
 	ret = jffs2_do_unlink(c, dir_f, dentry->d_name.name,
 			      dentry->d_name.len, dead_f, now);
 	if (dead_f->inocache)
 		set_nlink(d_inode(dentry), dead_f->inocache->pino_nlink);
 	if (!ret)
-		dir_i->i_mtime = dir_i->i_ctime = timespec_to_timespec64(ITIME(now));
+		dir_i->i_mtime = dir_i->i_ctime = ITIME(now);
 	return ret;
 }
 /***********************************************************************/
@@ -260,7 +260,7 @@ static int jffs2_link (struct dentry *old_dentry, struct inode *dir_i, struct de
 	type = (d_inode(old_dentry)->i_mode & S_IFMT) >> 12;
 	if (!type) type = DT_REG;
 
-	now = get_seconds();
+	now = JFFS2_NOW();
 	ret = jffs2_do_link(c, dir_f, f->inocache->ino, type, dentry->d_name.name, dentry->d_name.len, now);
 
 	if (!ret) {
@@ -268,7 +268,7 @@ static int jffs2_link (struct dentry *old_dentry, struct inode *dir_i, struct de
 		set_nlink(d_inode(old_dentry), ++f->inocache->pino_nlink);
 		mutex_unlock(&f->sem);
 		d_instantiate(dentry, d_inode(old_dentry));
-		dir_i->i_mtime = dir_i->i_ctime = timespec_to_timespec64(ITIME(now));
+		dir_i->i_mtime = dir_i->i_ctime = ITIME(now);
 		ihold(d_inode(old_dentry));
 	}
 	return ret;
@@ -400,7 +400,7 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char
 	rd->pino = cpu_to_je32(dir_i->i_ino);
 	rd->version = cpu_to_je32(++dir_f->highest_version);
 	rd->ino = cpu_to_je32(inode->i_ino);
-	rd->mctime = cpu_to_je32(get_seconds());
+	rd->mctime = cpu_to_je32(JFFS2_NOW());
 	rd->nsize = namelen;
 	rd->type = DT_LNK;
 	rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8));
@@ -418,7 +418,7 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char
 		goto fail;
 	}
 
-	dir_i->i_mtime = dir_i->i_ctime = timespec_to_timespec64(ITIME(je32_to_cpu(rd->mctime)));
+	dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(rd->mctime));
 
 	jffs2_free_raw_dirent(rd);
 
@@ -543,7 +543,7 @@ static int jffs2_mkdir (struct inode *dir_i, struct dentry *dentry, umode_t mode
 	rd->pino = cpu_to_je32(dir_i->i_ino);
 	rd->version = cpu_to_je32(++dir_f->highest_version);
 	rd->ino = cpu_to_je32(inode->i_ino);
-	rd->mctime = cpu_to_je32(get_seconds());
+	rd->mctime = cpu_to_je32(JFFS2_NOW());
 	rd->nsize = namelen;
 	rd->type = DT_DIR;
 	rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8));
@@ -561,7 +561,7 @@ static int jffs2_mkdir (struct inode *dir_i, struct dentry *dentry, umode_t mode
 		goto fail;
 	}
 
-	dir_i->i_mtime = dir_i->i_ctime = timespec_to_timespec64(ITIME(je32_to_cpu(rd->mctime)));
+	dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(rd->mctime));
 	inc_nlink(dir_i);
 
 	jffs2_free_raw_dirent(rd);
@@ -588,7 +588,7 @@ static int jffs2_rmdir (struct inode *dir_i, struct dentry *dentry)
 	struct jffs2_inode_info *f = JFFS2_INODE_INFO(d_inode(dentry));
 	struct jffs2_full_dirent *fd;
 	int ret;
-	uint32_t now = get_seconds();
+	uint32_t now = JFFS2_NOW();
 
 	for (fd = f->dents ; fd; fd = fd->next) {
 		if (fd->ino)
@@ -598,7 +598,7 @@ static int jffs2_rmdir (struct inode *dir_i, struct dentry *dentry)
 	ret = jffs2_do_unlink(c, dir_f, dentry->d_name.name,
 			      dentry->d_name.len, f, now);
 	if (!ret) {
-		dir_i->i_mtime = dir_i->i_ctime = timespec_to_timespec64(ITIME(now));
+		dir_i->i_mtime = dir_i->i_ctime = ITIME(now);
 		clear_nlink(d_inode(dentry));
 		drop_nlink(dir_i);
 	}
@@ -712,7 +712,7 @@ static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, umode_t mode
 	rd->pino = cpu_to_je32(dir_i->i_ino);
 	rd->version = cpu_to_je32(++dir_f->highest_version);
 	rd->ino = cpu_to_je32(inode->i_ino);
-	rd->mctime = cpu_to_je32(get_seconds());
+	rd->mctime = cpu_to_je32(JFFS2_NOW());
 	rd->nsize = namelen;
 
 	/* XXX: This is ugly. */
@@ -733,7 +733,7 @@ static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, umode_t mode
 		goto fail;
 	}
 
-	dir_i->i_mtime = dir_i->i_ctime = timespec_to_timespec64(ITIME(je32_to_cpu(rd->mctime)));
+	dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(rd->mctime));
 
 	jffs2_free_raw_dirent(rd);
 
@@ -797,7 +797,7 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry,
 	type = (d_inode(old_dentry)->i_mode & S_IFMT) >> 12;
 	if (!type) type = DT_REG;
 
-	now = get_seconds();
+	now = JFFS2_NOW();
 	ret = jffs2_do_link(c, JFFS2_INODE_INFO(new_dir_i),
 			    d_inode(old_dentry)->i_ino, type,
 			    new_dentry->d_name.name, new_dentry->d_name.len, now);
@@ -853,14 +853,14 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry,
 		 * caller won't do it on its own since we are returning an error.
 		 */
 		d_invalidate(new_dentry);
-		new_dir_i->i_mtime = new_dir_i->i_ctime = timespec_to_timespec64(ITIME(now));
+		new_dir_i->i_mtime = new_dir_i->i_ctime = ITIME(now);
 		return ret;
 	}
 
 	if (d_is_dir(old_dentry))
 		drop_nlink(old_dir_i);
 
-	new_dir_i->i_mtime = new_dir_i->i_ctime = old_dir_i->i_mtime = old_dir_i->i_ctime = timespec_to_timespec64(ITIME(now));
+	new_dir_i->i_mtime = new_dir_i->i_ctime = old_dir_i->i_mtime = old_dir_i->i_ctime = ITIME(now);
 
 	return 0;
 }
diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c
index 481afd4c2e1a..7d8654a1472e 100644
--- a/fs/jffs2/file.c
+++ b/fs/jffs2/file.c
@@ -175,7 +175,7 @@ static int jffs2_write_begin(struct file *filp, struct address_space *mapping,
 		ri.uid = cpu_to_je16(i_uid_read(inode));
 		ri.gid = cpu_to_je16(i_gid_read(inode));
 		ri.isize = cpu_to_je32(max((uint32_t)inode->i_size, pageofs));
-		ri.atime = ri.ctime = ri.mtime = cpu_to_je32(get_seconds());
+		ri.atime = ri.ctime = ri.mtime = cpu_to_je32(JFFS2_NOW());
 		ri.offset = cpu_to_je32(inode->i_size);
 		ri.dsize = cpu_to_je32(pageofs - inode->i_size);
 		ri.csize = cpu_to_je32(0);
@@ -283,7 +283,7 @@ static int jffs2_write_end(struct file *filp, struct address_space *mapping,
 	ri->uid = cpu_to_je16(i_uid_read(inode));
 	ri->gid = cpu_to_je16(i_gid_read(inode));
 	ri->isize = cpu_to_je32((uint32_t)inode->i_size);
-	ri->atime = ri->ctime = ri->mtime = cpu_to_je32(get_seconds());
+	ri->atime = ri->ctime = ri->mtime = cpu_to_je32(JFFS2_NOW());
 
 	/* In 2.4, it was already kmapped by generic_file_write(). Doesn't
 	   hurt to do it again. The alternative is ifdefs, which are ugly. */
@@ -308,7 +308,7 @@ static int jffs2_write_end(struct file *filp, struct address_space *mapping,
 			inode->i_size = pos + writtenlen;
 			inode->i_blocks = (inode->i_size + 511) >> 9;
 
-			inode->i_ctime = inode->i_mtime = timespec_to_timespec64(ITIME(je32_to_cpu(ri->ctime)));
+			inode->i_ctime = inode->i_mtime = ITIME(je32_to_cpu(ri->ctime));
 		}
 	}
 
diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c
index 0ecfb8ea38cd..eab04eca95a3 100644
--- a/fs/jffs2/fs.c
+++ b/fs/jffs2/fs.c
@@ -146,9 +146,9 @@ int jffs2_do_setattr (struct inode *inode, struct iattr *iattr)
 		return PTR_ERR(new_metadata);
 	}
 	/* It worked. Update the inode */
-	inode->i_atime = timespec_to_timespec64(ITIME(je32_to_cpu(ri->atime)));
-	inode->i_ctime = timespec_to_timespec64(ITIME(je32_to_cpu(ri->ctime)));
-	inode->i_mtime = timespec_to_timespec64(ITIME(je32_to_cpu(ri->mtime)));
+	inode->i_atime = ITIME(je32_to_cpu(ri->atime));
+	inode->i_ctime = ITIME(je32_to_cpu(ri->ctime));
+	inode->i_mtime = ITIME(je32_to_cpu(ri->mtime));
 	inode->i_mode = jemode_to_cpu(ri->mode);
 	i_uid_write(inode, je16_to_cpu(ri->uid));
 	i_gid_write(inode, je16_to_cpu(ri->gid));
@@ -280,9 +280,9 @@ struct inode *jffs2_iget(struct super_block *sb, unsigned long ino)
 	i_uid_write(inode, je16_to_cpu(latest_node.uid));
 	i_gid_write(inode, je16_to_cpu(latest_node.gid));
 	inode->i_size = je32_to_cpu(latest_node.isize);
-	inode->i_atime = timespec_to_timespec64(ITIME(je32_to_cpu(latest_node.atime)));
-	inode->i_mtime = timespec_to_timespec64(ITIME(je32_to_cpu(latest_node.mtime)));
-	inode->i_ctime = timespec_to_timespec64(ITIME(je32_to_cpu(latest_node.ctime)));
+	inode->i_atime = ITIME(je32_to_cpu(latest_node.atime));
+	inode->i_mtime = ITIME(je32_to_cpu(latest_node.mtime));
+	inode->i_ctime = ITIME(je32_to_cpu(latest_node.ctime));
 
 	set_nlink(inode, f->inocache->pino_nlink);
 
diff --git a/fs/jffs2/os-linux.h b/fs/jffs2/os-linux.h
index c2fbec19c616..acbe1f722f2d 100644
--- a/fs/jffs2/os-linux.h
+++ b/fs/jffs2/os-linux.h
@@ -31,7 +31,8 @@ struct kvec;
 #define JFFS2_F_I_GID(f) (i_gid_read(OFNI_EDONI_2SFFJ(f)))
 #define JFFS2_F_I_RDEV(f) (OFNI_EDONI_2SFFJ(f)->i_rdev)
 
-#define ITIME(sec) ((struct timespec){sec, 0})
+#define ITIME(sec) ((struct timespec64){(int32_t)sec, 0})
+#define JFFS2_NOW() (ktime_get_real_seconds())
 #define I_SEC(tv) ((tv).tv_sec)
 #define JFFS2_F_I_CTIME(f) (OFNI_EDONI_2SFFJ(f)->i_ctime.tv_sec)
 #define JFFS2_F_I_MTIME(f) (OFNI_EDONI_2SFFJ(f)->i_mtime.tv_sec)
-- 
2.9.0


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

* [PATCH 2/2] jffs2: use unsigned 32-bit timstamps consistently
  2018-06-19 15:59 [PATCH 1/2] jffs2: use 64-bit intermediate timestamps Arnd Bergmann
@ 2018-06-19 15:59 ` Arnd Bergmann
  2018-06-19 21:09   ` kbuild test robot
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2018-06-19 15:59 UTC (permalink / raw)
  To: David Woodhouse; +Cc: Arnd Bergmann, linux-mtd, linux-kernel

Most users of jffs2 are 32-bit systems that traditionally only support
timestamps using a 32-bit signed time_t, in the range from years 1902 to
2038. On 64-bit systems, jffs2 however interpreted the same timestamps
as unsigned values, reading back negative times (before 1970) as times
between 2038 and 2106.

Now that Linux supports 64-bit inode timestamps even on 32-bit systems,
let's use the second interpretation everywhere to allow jffs2 to be
used on 32-bit systems beyond 2038 without a fundamental change to the
inode format.

This has a slight risk of regressions, when existing files with timestamps
before 1970 are present in file system images and are now interpreted
as future time stamps. I considered moving the wraparound point a bit,
e.g. to 1960, in order to deal with timestamps that ended up on Dec 31,
1969 due to incorrect timezone handling. However, this would complicate
the implementation unnecessarily, so I went with the simplest possible
method of extending the timestamps.

Writing files with timestamps before 1970 or after 2106 now results
in those times being clamped in the file system.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/jffs2/os-linux.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/fs/jffs2/os-linux.h b/fs/jffs2/os-linux.h
index acbe1f722f2d..a2dbbb3f4c74 100644
--- a/fs/jffs2/os-linux.h
+++ b/fs/jffs2/os-linux.h
@@ -31,13 +31,13 @@ struct kvec;
 #define JFFS2_F_I_GID(f) (i_gid_read(OFNI_EDONI_2SFFJ(f)))
 #define JFFS2_F_I_RDEV(f) (OFNI_EDONI_2SFFJ(f)->i_rdev)
 
-#define ITIME(sec) ((struct timespec64){(int32_t)sec, 0})
-#define JFFS2_NOW() (ktime_get_real_seconds())
-#define I_SEC(tv) ((tv).tv_sec)
-#define JFFS2_F_I_CTIME(f) (OFNI_EDONI_2SFFJ(f)->i_ctime.tv_sec)
-#define JFFS2_F_I_MTIME(f) (OFNI_EDONI_2SFFJ(f)->i_mtime.tv_sec)
-#define JFFS2_F_I_ATIME(f) (OFNI_EDONI_2SFFJ(f)->i_atime.tv_sec)
-
+#define JFFS2_CLAMP_TIME(t) ((uint32_t)clamp_t(time64_t, (t), 0, U32_MAX))
+#define ITIME(sec) ((struct timespec64){sec, 0})
+#define JFFS2_NOW() JFFS2_CLAMP_TIME(ktime_get_real_seconds())
+#define I_SEC(tv) JFFS2_CLAMP_TIME((tv).tv_sec)
+#define JFFS2_F_I_CTIME(f) I_SEC(OFNI_EDONI_2SFFJ(f)->i_ctime)
+#define JFFS2_F_I_MTIME(f) I_SEC(OFNI_EDONI_2SFFJ(f)->i_mtime)
+#define JFFS2_F_I_ATIME(f) I_SEC(OFNI_EDONI_2SFFJ(f)->i_atime)
 #define sleep_on_spinunlock(wq, s)				\
 	do {							\
 		DECLARE_WAITQUEUE(__wait, current);		\
-- 
2.9.0


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

* Re: [PATCH 2/2] jffs2: use unsigned 32-bit timstamps consistently
  2018-06-19 15:59 ` [PATCH 2/2] jffs2: use unsigned 32-bit timstamps consistently Arnd Bergmann
@ 2018-06-19 21:09   ` kbuild test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kbuild test robot @ 2018-06-19 21:09 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: kbuild-all, David Woodhouse, Arnd Bergmann, linux-mtd, linux-kernel

Hi Arnd,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v4.18-rc1 next-20180619]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Arnd-Bergmann/jffs2-use-64-bit-intermediate-timestamps/20180620-015800
reproduce:
        # apt-get install sparse
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

>> fs/jffs2/dir.c:263:15: sparse: expression using sizeof(void)
>> fs/jffs2/dir.c:263:15: sparse: expression using sizeof(void)
>> fs/jffs2/dir.c:263:15: sparse: expression using sizeof(void)
>> fs/jffs2/dir.c:263:15: sparse: expression using sizeof(void)
>> fs/jffs2/dir.c:263:15: sparse: expression using sizeof(void)
>> fs/jffs2/dir.c:263:15: sparse: expression using sizeof(void)
>> fs/jffs2/dir.c:263:15: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:230:24: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:230:24: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:230:24: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:230:24: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:230:24: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:230:24: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:230:24: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:403:22: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:403:22: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:403:22: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:403:22: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:403:22: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:403:22: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:403:22: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:546:22: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:546:22: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:546:22: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:546:22: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:546:22: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:546:22: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:546:22: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:591:24: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:591:24: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:591:24: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:591:24: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:591:24: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:591:24: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:591:24: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:715:22: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:715:22: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:715:22: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:715:22: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:715:22: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:715:22: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:715:22: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:800:15: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:800:15: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:800:15: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:800:15: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:800:15: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:800:15: sparse: expression using sizeof(void)
   fs/jffs2/dir.c:800:15: sparse: expression using sizeof(void)
--
>> fs/jffs2/fs.c:115:21: sparse: expression using sizeof(void)
>> fs/jffs2/fs.c:115:21: sparse: expression using sizeof(void)
>> fs/jffs2/fs.c:115:21: sparse: expression using sizeof(void)
>> fs/jffs2/fs.c:115:21: sparse: expression using sizeof(void)
>> fs/jffs2/fs.c:115:21: sparse: expression using sizeof(void)
>> fs/jffs2/fs.c:115:21: sparse: expression using sizeof(void)
>> fs/jffs2/fs.c:115:21: sparse: expression using sizeof(void)
   fs/jffs2/fs.c:116:21: sparse: expression using sizeof(void)
   fs/jffs2/fs.c:116:21: sparse: expression using sizeof(void)
   fs/jffs2/fs.c:116:21: sparse: expression using sizeof(void)
   fs/jffs2/fs.c:116:21: sparse: expression using sizeof(void)
   fs/jffs2/fs.c:116:21: sparse: expression using sizeof(void)
   fs/jffs2/fs.c:116:21: sparse: expression using sizeof(void)
   fs/jffs2/fs.c:116:21: sparse: expression using sizeof(void)
   fs/jffs2/fs.c:117:21: sparse: expression using sizeof(void)
   fs/jffs2/fs.c:117:21: sparse: expression using sizeof(void)
   fs/jffs2/fs.c:117:21: sparse: expression using sizeof(void)
   fs/jffs2/fs.c:117:21: sparse: expression using sizeof(void)
   fs/jffs2/fs.c:117:21: sparse: expression using sizeof(void)
   fs/jffs2/fs.c:117:21: sparse: expression using sizeof(void)
   fs/jffs2/fs.c:117:21: sparse: expression using sizeof(void)
   fs/jffs2/fs.c:476:45: sparse: expression using sizeof(void)
   fs/jffs2/fs.c:476:45: sparse: expression using sizeof(void)
   fs/jffs2/fs.c:476:45: sparse: expression using sizeof(void)
   fs/jffs2/fs.c:476:45: sparse: expression using sizeof(void)
   fs/jffs2/fs.c:476:45: sparse: expression using sizeof(void)
   fs/jffs2/fs.c:476:45: sparse: expression using sizeof(void)
   fs/jffs2/fs.c:476:45: sparse: expression using sizeof(void)
   include/linux/slab.h:631:13: sparse: undefined identifier '__builtin_mul_overflow'
   include/linux/slab.h:631:13: sparse: call with no type!

vim +263 fs/jffs2/dir.c

^1da177e Linus Torvalds      2005-04-16  241  
^1da177e Linus Torvalds      2005-04-16  242  
^1da177e Linus Torvalds      2005-04-16  243  static int jffs2_link (struct dentry *old_dentry, struct inode *dir_i, struct dentry *dentry)
^1da177e Linus Torvalds      2005-04-16  244  {
fc64005c Al Viro             2016-04-10  245  	struct jffs2_sb_info *c = JFFS2_SB_INFO(old_dentry->d_sb);
2b0143b5 David Howells       2015-03-17  246  	struct jffs2_inode_info *f = JFFS2_INODE_INFO(d_inode(old_dentry));
^1da177e Linus Torvalds      2005-04-16  247  	struct jffs2_inode_info *dir_f = JFFS2_INODE_INFO(dir_i);
^1da177e Linus Torvalds      2005-04-16  248  	int ret;
^1da177e Linus Torvalds      2005-04-16  249  	uint8_t type;
3a69e0cd Artem B. Bityutskiy 2005-08-17  250  	uint32_t now;
^1da177e Linus Torvalds      2005-04-16  251  
^1da177e Linus Torvalds      2005-04-16  252  	/* Don't let people make hard links to bad inodes. */
^1da177e Linus Torvalds      2005-04-16  253  	if (!f->inocache)
^1da177e Linus Torvalds      2005-04-16  254  		return -EIO;
^1da177e Linus Torvalds      2005-04-16  255  
e36cb0b8 David Howells       2015-01-29  256  	if (d_is_dir(old_dentry))
^1da177e Linus Torvalds      2005-04-16  257  		return -EPERM;
^1da177e Linus Torvalds      2005-04-16  258  
^1da177e Linus Torvalds      2005-04-16  259  	/* XXX: This is ugly */
2b0143b5 David Howells       2015-03-17  260  	type = (d_inode(old_dentry)->i_mode & S_IFMT) >> 12;
^1da177e Linus Torvalds      2005-04-16  261  	if (!type) type = DT_REG;
^1da177e Linus Torvalds      2005-04-16  262  
a7cab044 Arnd Bergmann       2018-06-19 @263  	now = JFFS2_NOW();
3a69e0cd Artem B. Bityutskiy 2005-08-17  264  	ret = jffs2_do_link(c, dir_f, f->inocache->ino, type, dentry->d_name.name, dentry->d_name.len, now);
^1da177e Linus Torvalds      2005-04-16  265  
^1da177e Linus Torvalds      2005-04-16  266  	if (!ret) {
ced22070 David Woodhouse     2008-04-22  267  		mutex_lock(&f->sem);
2b0143b5 David Howells       2015-03-17  268  		set_nlink(d_inode(old_dentry), ++f->inocache->pino_nlink);
ced22070 David Woodhouse     2008-04-22  269  		mutex_unlock(&f->sem);
2b0143b5 David Howells       2015-03-17  270  		d_instantiate(dentry, d_inode(old_dentry));
a7cab044 Arnd Bergmann       2018-06-19  271  		dir_i->i_mtime = dir_i->i_ctime = ITIME(now);
2b0143b5 David Howells       2015-03-17  272  		ihold(d_inode(old_dentry));
^1da177e Linus Torvalds      2005-04-16  273  	}
^1da177e Linus Torvalds      2005-04-16  274  	return ret;
^1da177e Linus Torvalds      2005-04-16  275  }
^1da177e Linus Torvalds      2005-04-16  276  

:::::: The code at line 263 was first introduced by commit
:::::: a7cab044350466ac53107fa859f1f2cbc4d5112b jffs2: use 64-bit intermediate timestamps

:::::: TO: Arnd Bergmann <arnd@arndb.de>
:::::: CC: 0day robot <lkp@intel.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

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

end of thread, other threads:[~2018-06-19 21:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-19 15:59 [PATCH 1/2] jffs2: use 64-bit intermediate timestamps Arnd Bergmann
2018-06-19 15:59 ` [PATCH 2/2] jffs2: use unsigned 32-bit timstamps consistently Arnd Bergmann
2018-06-19 21:09   ` kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).