Hello,
kernel test robot noticed "xfstests.generic.371.fail" on:
commit: 979492850abd8e0d6ab0081be7593b32e5e6c9cc ("ext4: convert to ctime accessor functions")
https://git.kernel.org/cgit/linux/kernel/git/vfs/vfs.git vfs.ctime
in testcase: xfstests
version: xfstests-x86_64-bb8af9c-1_20230724
with following parameters:
disk: 4HDD
fs: ext4
test: generic-371
compiler: gcc-12
test machine: 8 threads Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz (Skylake) with 16G memory
(please refer to attached dmesg/kmsg for entire log/backtrace)
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 <[email protected]>
| Closes: https://lore.kernel.org/oe-lkp/[email protected]
2023-07-26 19:20:06 export TEST_DIR=/fs/sdb1
2023-07-26 19:20:06 export TEST_DEV=/dev/sdb1
2023-07-26 19:20:06 export FSTYP=ext4
2023-07-26 19:20:06 export SCRATCH_MNT=/fs/scratch
2023-07-26 19:20:06 mkdir /fs/scratch -p
2023-07-26 19:20:06 export SCRATCH_DEV=/dev/sdb4
2023-07-26 19:20:06 echo generic/371
2023-07-26 19:20:06 ./check -E tests/exclude/ext4 generic/371
FSTYP -- ext4
PLATFORM -- Linux/x86_64 lkp-skl-d07 6.5.0-rc1-00042-g979492850abd #1 SMP PREEMPT_DYNAMIC Thu Jul 27 02:18:45 CST 2023
MKFS_OPTIONS -- -F /dev/sdb4
MOUNT_OPTIONS -- -o acl,user_xattr /dev/sdb4 /fs/scratch
generic/371 _check_generic_filesystem: filesystem on /dev/sdb4 is inconsistent
(see /lkp/benchmarks/xfstests/results//generic/371.full for details)
Ran: generic/371
Failures: generic/371
Failed 1 of 1 tests
To reproduce:
git clone https://github.com/intel/lkp-tests.git
cd lkp-tests
sudo bin/lkp install job.yaml # job file is attached in this email
bin/lkp split-job --compatible job.yaml # generate the yaml file for lkp run
sudo bin/lkp run generated-yaml-file
# if come across any failure that blocks the test,
# please remove ~/.lkp and /lkp dir to run from a clean state.
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
On Thu, Jul 27, 2023 at 01:32:52PM +0800, kernel test robot wrote:
>
>
> Hello,
>
> kernel test robot noticed "xfstests.generic.371.fail" on:
>
> commit: 979492850abd8e0d6ab0081be7593b32e5e6c9cc ("ext4: convert to ctime accessor functions")
> https://git.kernel.org/cgit/linux/kernel/git/vfs/vfs.git vfs.ctime
This is outdated the diff between the commit version referenced here and
the one currently in the branch is:
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 2af347669db7..1e2259d9967d 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -900,8 +900,10 @@ do { \
#define EXT4_INODE_SET_CTIME(inode, raw_inode) \
EXT4_INODE_SET_XTIME_VAL(i_ctime, inode, raw_inode, inode_get_ctime(inode))
-#define EXT4_EINODE_SET_XTIME(xtime, einode, raw_inode) \
- EXT4_INODE_SET_XTIME_VAL(xtime, &((einode)->vfs_inode), raw_inode, (einode)->xtime)
+#define EXT4_EINODE_SET_XTIME(xtime, einode, raw_inode) \
+ if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime)) \
+ EXT4_INODE_SET_XTIME_VAL(xtime, &((einode)->vfs_inode), \
+ raw_inode, (einode)->xtime)
#define EXT4_INODE_GET_XTIME_VAL(xtime, inode, raw_inode) \
(EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), xtime ## _extra) ? \
@@ -922,9 +924,14 @@ do { \
EXT4_INODE_GET_XTIME_VAL(i_ctime, inode, raw_inode)); \
} while (0)
-#define EXT4_EINODE_GET_XTIME(xtime, einode, raw_inode) \
-do { \
- (einode)->xtime = EXT4_INODE_GET_XTIME_VAL(xtime, &(einode->vfs_inode), raw_inode); \
+#define EXT4_EINODE_GET_XTIME(xtime, einode, raw_inode) \
+do { \
+ if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime)) \
+ (einode)->xtime = \
+ EXT4_INODE_GET_XTIME_VAL(xtime, &(einode->vfs_inode), \
+ raw_inode); \
+ else \
+ (einode)->xtime = (struct timespec64){0, 0}; \
} while (0)
#define i_disk_version osd1.linux1.l_i_version
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 07f6d96ebc60..933ad03f4f58 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -3957,7 +3957,7 @@ static int ext4_rename(struct mnt_idmap *idmap, struct inode *old_dir,
ext4_dec_count(new.inode);
inode_set_ctime_current(new.inode);
}
- old.dir->i_mtime = inode_set_ctime_current(old.inode);
+ old.dir->i_mtime = inode_set_ctime_current(old.dir);
ext4_update_dx_flag(old.dir);
if (old.dir_bh) {
retval = ext4_rename_dir_finish(handle, &old, new.dir->i_ino);
With that I can't reproduce the reported failure.
FSTYP -- ext4
PLATFORM -- Linux/x86_64 imp1-vm 6.5.0-rc1-vfs-all-91bcc05fab9b #139 SMP PREEMPT_DYNAMIC Wed Jul 26 15:51:58 UTC 2023
MKFS_OPTIONS -- -F /dev/sda4
MOUNT_OPTIONS -- -o acl,user_xattr /dev/sda4 /mnt/scratch
generic/371 10s ... 15s
Ran: generic/371
Passed all 1 tests