tree:
https://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git
2021-03-15/xfstests
head: 2bbe0fe85cd29ed30d81564c0b679d10563bb168
commit: 2bbe0fe85cd29ed30d81564c0b679d10563bb168 [3/3] Merge remote-tracking branch
'xfs/xfs-5.12-fixes' into 2021-03-15/xfstests
config: alpha-randconfig-r033-20210315 (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.0
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
#
https://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git/commit/...
git remote add brauner
https://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git
git fetch --no-tags brauner 2021-03-15/xfstests
git checkout 2bbe0fe85cd29ed30d81564c0b679d10563bb168
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=alpha
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
fs/xfs/xfs_inode.c: In function 'xfs_create':
> fs/xfs/xfs_inode.c:1010:33: error: implicit declaration of
function 'fsuid_into_mnt'; did you mean 'i_uid_into_mnt'?
[-Werror=implicit-function-declaration]
1010 | error = xfs_qm_vop_dqalloc(dp,
fsuid_into_mnt(mnt_userns),
| ^~~~~~~~~~~~~~
| i_uid_into_mnt
> fs/xfs/xfs_inode.c:1011:4: error: implicit declaration of
function 'fsgid_into_mnt'; did you mean 'i_gid_into_mnt'?
[-Werror=implicit-function-declaration]
1011 | fsgid_into_mnt(mnt_userns),
prid,
| ^~~~~~~~~~~~~~
| i_gid_into_mnt
> fs/xfs/xfs_inode.c:1010:33: error: incompatible type for argument
2 of 'xfs_qm_vop_dqalloc'
1010 | error = xfs_qm_vop_dqalloc(dp,
fsuid_into_mnt(mnt_userns),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| int
In file included from fs/xfs/xfs_inode.c:29:
fs/xfs/xfs_quota.h:93:51: note: expected 'kuid_t' {aka 'struct
<anonymous>'} but argument is of type 'int'
93 | extern int xfs_qm_vop_dqalloc(struct xfs_inode *, kuid_t, kgid_t,
| ^~~~~~
fs/xfs/xfs_inode.c:1011:4: error: incompatible type for argument 3 of
'xfs_qm_vop_dqalloc'
1011 | fsgid_into_mnt(mnt_userns), prid,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| int
In file included from fs/xfs/xfs_inode.c:29:
fs/xfs/xfs_quota.h:93:59: note: expected 'kgid_t' {aka 'struct
<anonymous>'} but argument is of type 'int'
93 | extern int xfs_qm_vop_dqalloc(struct xfs_inode *, kuid_t, kgid_t,
| ^~~~~~
fs/xfs/xfs_inode.c: In function 'xfs_create_tmpfile':
fs/xfs/xfs_inode.c:1161:33: error: incompatible type for argument 2 of
'xfs_qm_vop_dqalloc'
1161 | error = xfs_qm_vop_dqalloc(dp, fsuid_into_mnt(mnt_userns),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| int
In file included from fs/xfs/xfs_inode.c:29:
fs/xfs/xfs_quota.h:93:51: note: expected 'kuid_t' {aka 'struct
<anonymous>'} but argument is of type 'int'
93 | extern int xfs_qm_vop_dqalloc(struct xfs_inode *, kuid_t, kgid_t,
| ^~~~~~
fs/xfs/xfs_inode.c:1162:4: error: incompatible type for argument 3 of
'xfs_qm_vop_dqalloc'
1162 | fsgid_into_mnt(mnt_userns), prid,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| int
In file included from fs/xfs/xfs_inode.c:29:
fs/xfs/xfs_quota.h:93:59: note: expected 'kgid_t' {aka 'struct
<anonymous>'} but argument is of type 'int'
93 | extern int xfs_qm_vop_dqalloc(struct xfs_inode *, kuid_t, kgid_t,
| ^~~~~~
cc1: some warnings being treated as errors
--
fs/xfs/xfs_symlink.c: In function 'xfs_symlink':
> fs/xfs/xfs_symlink.c:185:33: error: implicit declaration of
function 'fsuid_into_mnt'; did you mean 'i_uid_into_mnt'?
[-Werror=implicit-function-declaration]
185 | error = xfs_qm_vop_dqalloc(dp,
fsuid_into_mnt(mnt_userns),
| ^~~~~~~~~~~~~~
| i_uid_into_mnt
> fs/xfs/xfs_symlink.c:186:4: error: implicit declaration of
function 'fsgid_into_mnt'; did you mean 'i_gid_into_mnt'?
[-Werror=implicit-function-declaration]
186 | fsgid_into_mnt(mnt_userns),
prid,
| ^~~~~~~~~~~~~~
| i_gid_into_mnt
> fs/xfs/xfs_symlink.c:185:33: error: incompatible type for
argument 2 of 'xfs_qm_vop_dqalloc'
185 | error =
xfs_qm_vop_dqalloc(dp, fsuid_into_mnt(mnt_userns),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| int
In file included from fs/xfs/xfs_symlink.c:19:
fs/xfs/xfs_quota.h:93:51: note: expected 'kuid_t' {aka 'struct
<anonymous>'} but argument is of type 'int'
93 | extern int xfs_qm_vop_dqalloc(struct xfs_inode *, kuid_t, kgid_t,
| ^~~~~~
fs/xfs/xfs_symlink.c:186:4: error: incompatible type for argument 3 of
'xfs_qm_vop_dqalloc'
186 | fsgid_into_mnt(mnt_userns), prid,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| int
In file included from fs/xfs/xfs_symlink.c:19:
fs/xfs/xfs_quota.h:93:59: note: expected 'kgid_t' {aka 'struct
<anonymous>'} but argument is of type 'int'
93 | extern int xfs_qm_vop_dqalloc(struct xfs_inode *, kuid_t, kgid_t,
| ^~~~~~
cc1: some warnings being treated as errors
vim +1010 fs/xfs/xfs_inode.c
e546cb79ef7ebe Dave Chinner 2013-08-12 977
c24b5dfadc4a4f Dave Chinner 2013-08-12 978 int
c24b5dfadc4a4f Dave Chinner 2013-08-12 979 xfs_create(
f736d93d76d3e9 Christoph Hellwig 2021-01-21 980 struct user_namespace *mnt_userns,
c24b5dfadc4a4f Dave Chinner 2013-08-12 981 xfs_inode_t *dp,
c24b5dfadc4a4f Dave Chinner 2013-08-12 982 struct xfs_name *name,
c24b5dfadc4a4f Dave Chinner 2013-08-12 983 umode_t mode,
66f364649d870c Christoph Hellwig 2017-10-19 984 dev_t rdev,
c24b5dfadc4a4f Dave Chinner 2013-08-12 985 xfs_inode_t **ipp)
c24b5dfadc4a4f Dave Chinner 2013-08-12 986 {
c24b5dfadc4a4f Dave Chinner 2013-08-12 987 int is_dir = S_ISDIR(mode);
c24b5dfadc4a4f Dave Chinner 2013-08-12 988 struct xfs_mount *mp =
dp->i_mount;
c24b5dfadc4a4f Dave Chinner 2013-08-12 989 struct xfs_inode *ip = NULL;
c24b5dfadc4a4f Dave Chinner 2013-08-12 990 struct xfs_trans *tp = NULL;
c24b5dfadc4a4f Dave Chinner 2013-08-12 991 int error;
c24b5dfadc4a4f Dave Chinner 2013-08-12 992 bool
unlock_dp_on_error = false;
c24b5dfadc4a4f Dave Chinner 2013-08-12 993 prid_t prid;
c24b5dfadc4a4f Dave Chinner 2013-08-12 994 struct xfs_dquot *udqp = NULL;
c24b5dfadc4a4f Dave Chinner 2013-08-12 995 struct xfs_dquot *gdqp = NULL;
c24b5dfadc4a4f Dave Chinner 2013-08-12 996 struct xfs_dquot *pdqp = NULL;
062647a8b41928 Brian Foster 2014-11-28 997 struct xfs_trans_res *tres;
c24b5dfadc4a4f Dave Chinner 2013-08-12 998 uint resblks;
c24b5dfadc4a4f Dave Chinner 2013-08-12 999
c24b5dfadc4a4f Dave Chinner 2013-08-12 1000 trace_xfs_create(dp, name);
c24b5dfadc4a4f Dave Chinner 2013-08-12 1001
c24b5dfadc4a4f Dave Chinner 2013-08-12 1002 if (XFS_FORCED_SHUTDOWN(mp))
2451337dd04390 Dave Chinner 2014-06-25 1003 return -EIO;
c24b5dfadc4a4f Dave Chinner 2013-08-12 1004
163467d3753e77 Zhi Yong Wu 2013-12-18 1005 prid = xfs_get_initial_prid(dp);
c24b5dfadc4a4f Dave Chinner 2013-08-12 1006
c24b5dfadc4a4f Dave Chinner 2013-08-12 1007 /*
c24b5dfadc4a4f Dave Chinner 2013-08-12 1008 * Make sure that we have allocated
dquot(s) on disk.
c24b5dfadc4a4f Dave Chinner 2013-08-12 1009 */
b5a08423da9da5 Darrick J. Wong 2021-03-02 @1010 error = xfs_qm_vop_dqalloc(dp,
fsuid_into_mnt(mnt_userns),
b5a08423da9da5 Darrick J. Wong 2021-03-02 @1011 fsgid_into_mnt(mnt_userns), prid,
c24b5dfadc4a4f Dave Chinner 2013-08-12 1012 XFS_QMOPT_QUOTALL |
XFS_QMOPT_INHERIT,
c24b5dfadc4a4f Dave Chinner 2013-08-12 1013 &udqp, &gdqp, &pdqp);
c24b5dfadc4a4f Dave Chinner 2013-08-12 1014 if (error)
c24b5dfadc4a4f Dave Chinner 2013-08-12 1015 return error;
c24b5dfadc4a4f Dave Chinner 2013-08-12 1016
c24b5dfadc4a4f Dave Chinner 2013-08-12 1017 if (is_dir) {
c24b5dfadc4a4f Dave Chinner 2013-08-12 1018 resblks = XFS_MKDIR_SPACE_RES(mp,
name->len);
062647a8b41928 Brian Foster 2014-11-28 1019 tres = &M_RES(mp)->tr_mkdir;
c24b5dfadc4a4f Dave Chinner 2013-08-12 1020 } else {
c24b5dfadc4a4f Dave Chinner 2013-08-12 1021 resblks = XFS_CREATE_SPACE_RES(mp,
name->len);
062647a8b41928 Brian Foster 2014-11-28 1022 tres = &M_RES(mp)->tr_create;
c24b5dfadc4a4f Dave Chinner 2013-08-12 1023 }
c24b5dfadc4a4f Dave Chinner 2013-08-12 1024
c24b5dfadc4a4f Dave Chinner 2013-08-12 1025 /*
c24b5dfadc4a4f Dave Chinner 2013-08-12 1026 * Initially assume that the file does
not exist and
c24b5dfadc4a4f Dave Chinner 2013-08-12 1027 * reserve the resources for that
case. If that is not
c24b5dfadc4a4f Dave Chinner 2013-08-12 1028 * the case we'll drop the one we
have and get a more
c24b5dfadc4a4f Dave Chinner 2013-08-12 1029 * appropriate transaction later.
c24b5dfadc4a4f Dave Chinner 2013-08-12 1030 */
f2f7b9ff62a289 Darrick J. Wong 2021-01-27 1031 error = xfs_trans_alloc_icreate(mp,
tres, udqp, gdqp, pdqp, resblks,
f2f7b9ff62a289 Darrick J. Wong 2021-01-27 1032 &tp);
2451337dd04390 Dave Chinner 2014-06-25 1033 if (error == -ENOSPC) {
c24b5dfadc4a4f Dave Chinner 2013-08-12 1034 /* flush outstanding delalloc blocks
and retry */
c24b5dfadc4a4f Dave Chinner 2013-08-12 1035 xfs_flush_inodes(mp);
f2f7b9ff62a289 Darrick J. Wong 2021-01-27 1036 error = xfs_trans_alloc_icreate(mp,
tres, udqp, gdqp, pdqp,
f2f7b9ff62a289 Darrick J. Wong 2021-01-27 1037 resblks, &tp);
c24b5dfadc4a4f Dave Chinner 2013-08-12 1038 }
4906e21545814e Christoph Hellwig 2015-06-04 1039 if (error)
f2f7b9ff62a289 Darrick J. Wong 2021-01-27 1040 goto out_release_dquots;
c24b5dfadc4a4f Dave Chinner 2013-08-12 1041
6552321831dce8 Christoph Hellwig 2016-11-30 1042 xfs_ilock(dp, XFS_ILOCK_EXCL |
XFS_ILOCK_PARENT);
c24b5dfadc4a4f Dave Chinner 2013-08-12 1043 unlock_dp_on_error = true;
c24b5dfadc4a4f Dave Chinner 2013-08-12 1044
f5d92749191402 Chandan Babu R 2021-01-22 1045 error =
xfs_iext_count_may_overflow(dp, XFS_DATA_FORK,
f5d92749191402 Chandan Babu R 2021-01-22 1046 XFS_IEXT_DIR_MANIP_CNT(mp));
f5d92749191402 Chandan Babu R 2021-01-22 1047 if (error)
f5d92749191402 Chandan Babu R 2021-01-22 1048 goto out_trans_cancel;
f5d92749191402 Chandan Babu R 2021-01-22 1049
c24b5dfadc4a4f Dave Chinner 2013-08-12 1050 /*
c24b5dfadc4a4f Dave Chinner 2013-08-12 1051 * A newly created regular or special
file just has one directory
c24b5dfadc4a4f Dave Chinner 2013-08-12 1052 * entry pointing to them, but a
directory also the "." entry
c24b5dfadc4a4f Dave Chinner 2013-08-12 1053 * pointing to itself.
c24b5dfadc4a4f Dave Chinner 2013-08-12 1054 */
f736d93d76d3e9 Christoph Hellwig 2021-01-21 1055 error = xfs_dir_ialloc(mnt_userns,
&tp, dp, mode, is_dir ? 2 : 1, rdev,
f736d93d76d3e9 Christoph Hellwig 2021-01-21 1056 prid, &ip);
d6077aa339d658 Jan Kara 2015-07-29 1057 if (error)
4906e21545814e Christoph Hellwig 2015-06-04 1058 goto out_trans_cancel;
c24b5dfadc4a4f Dave Chinner 2013-08-12 1059
c24b5dfadc4a4f Dave Chinner 2013-08-12 1060 /*
c24b5dfadc4a4f Dave Chinner 2013-08-12 1061 * Now we join the directory inode to
the transaction. We do not do it
c24b5dfadc4a4f Dave Chinner 2013-08-12 1062 * earlier because xfs_dir_ialloc
might commit the previous transaction
c24b5dfadc4a4f Dave Chinner 2013-08-12 1063 * (and release all the locks). An
error from here on will result in
c24b5dfadc4a4f Dave Chinner 2013-08-12 1064 * the transaction cancel unlocking dp
so don't do it explicitly in the
c24b5dfadc4a4f Dave Chinner 2013-08-12 1065 * error path.
c24b5dfadc4a4f Dave Chinner 2013-08-12 1066 */
6552321831dce8 Christoph Hellwig 2016-11-30 1067 xfs_trans_ijoin(tp, dp,
XFS_ILOCK_EXCL);
c24b5dfadc4a4f Dave Chinner 2013-08-12 1068 unlock_dp_on_error = false;
c24b5dfadc4a4f Dave Chinner 2013-08-12 1069
381eee69f862d3 Brian Foster 2018-07-11 1070 error = xfs_dir_createname(tp, dp,
name, ip->i_ino,
63337b63e7dab6 Kaixu Xia 2020-03-27 1071 resblks -
XFS_IALLOC_SPACE_RES(mp));
c24b5dfadc4a4f Dave Chinner 2013-08-12 1072 if (error) {
2451337dd04390 Dave Chinner 2014-06-25 1073 ASSERT(error != -ENOSPC);
4906e21545814e Christoph Hellwig 2015-06-04 1074 goto out_trans_cancel;
c24b5dfadc4a4f Dave Chinner 2013-08-12 1075 }
c24b5dfadc4a4f Dave Chinner 2013-08-12 1076 xfs_trans_ichgtime(tp, dp,
XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
c24b5dfadc4a4f Dave Chinner 2013-08-12 1077 xfs_trans_log_inode(tp, dp,
XFS_ILOG_CORE);
c24b5dfadc4a4f Dave Chinner 2013-08-12 1078
c24b5dfadc4a4f Dave Chinner 2013-08-12 1079 if (is_dir) {
c24b5dfadc4a4f Dave Chinner 2013-08-12 1080 error = xfs_dir_init(tp, ip, dp);
c24b5dfadc4a4f Dave Chinner 2013-08-12 1081 if (error)
c8eac49ef798a7 Brian Foster 2018-07-24 1082 goto out_trans_cancel;
c24b5dfadc4a4f Dave Chinner 2013-08-12 1083
910832697cf855 Eric Sandeen 2019-05-01 1084 xfs_bumplink(tp, dp);
c24b5dfadc4a4f Dave Chinner 2013-08-12 1085 }
c24b5dfadc4a4f Dave Chinner 2013-08-12 1086
c24b5dfadc4a4f Dave Chinner 2013-08-12 1087 /*
c24b5dfadc4a4f Dave Chinner 2013-08-12 1088 * If this is a synchronous mount,
make sure that the
c24b5dfadc4a4f Dave Chinner 2013-08-12 1089 * create transaction goes to disk
before returning to
c24b5dfadc4a4f Dave Chinner 2013-08-12 1090 * the user.
c24b5dfadc4a4f Dave Chinner 2013-08-12 1091 */
c24b5dfadc4a4f Dave Chinner 2013-08-12 1092 if (mp->m_flags &
(XFS_MOUNT_WSYNC|XFS_MOUNT_DIRSYNC))
c24b5dfadc4a4f Dave Chinner 2013-08-12 1093 xfs_trans_set_sync(tp);
c24b5dfadc4a4f Dave Chinner 2013-08-12 1094
c24b5dfadc4a4f Dave Chinner 2013-08-12 1095 /*
c24b5dfadc4a4f Dave Chinner 2013-08-12 1096 * Attach the dquot(s) to the inodes
and modify them incore.
c24b5dfadc4a4f Dave Chinner 2013-08-12 1097 * These ids of the inode couldn't
have changed since the new
c24b5dfadc4a4f Dave Chinner 2013-08-12 1098 * inode has been locked ever since it
was created.
c24b5dfadc4a4f Dave Chinner 2013-08-12 1099 */
c24b5dfadc4a4f Dave Chinner 2013-08-12 1100 xfs_qm_vop_create_dqattach(tp, ip,
udqp, gdqp, pdqp);
c24b5dfadc4a4f Dave Chinner 2013-08-12 1101
70393313dd0b26 Christoph Hellwig 2015-06-04 1102 error = xfs_trans_commit(tp);
c24b5dfadc4a4f Dave Chinner 2013-08-12 1103 if (error)
c24b5dfadc4a4f Dave Chinner 2013-08-12 1104 goto out_release_inode;
c24b5dfadc4a4f Dave Chinner 2013-08-12 1105
c24b5dfadc4a4f Dave Chinner 2013-08-12 1106 xfs_qm_dqrele(udqp);
c24b5dfadc4a4f Dave Chinner 2013-08-12 1107 xfs_qm_dqrele(gdqp);
c24b5dfadc4a4f Dave Chinner 2013-08-12 1108 xfs_qm_dqrele(pdqp);
c24b5dfadc4a4f Dave Chinner 2013-08-12 1109
c24b5dfadc4a4f Dave Chinner 2013-08-12 1110 *ipp = ip;
c24b5dfadc4a4f Dave Chinner 2013-08-12 1111 return 0;
c24b5dfadc4a4f Dave Chinner 2013-08-12 1112
c24b5dfadc4a4f Dave Chinner 2013-08-12 1113 out_trans_cancel:
4906e21545814e Christoph Hellwig 2015-06-04 1114 xfs_trans_cancel(tp);
c24b5dfadc4a4f Dave Chinner 2013-08-12 1115 out_release_inode:
c24b5dfadc4a4f Dave Chinner 2013-08-12 1116 /*
58c904734cd091 Dave Chinner 2015-02-23 1117 * Wait until after the current
transaction is aborted to finish the
58c904734cd091 Dave Chinner 2015-02-23 1118 * setup of the inode and release the
inode. This prevents recursive
58c904734cd091 Dave Chinner 2015-02-23 1119 * transactions and deadlocks from
xfs_inactive.
c24b5dfadc4a4f Dave Chinner 2013-08-12 1120 */
58c904734cd091 Dave Chinner 2015-02-23 1121 if (ip) {
58c904734cd091 Dave Chinner 2015-02-23 1122 xfs_finish_inode_setup(ip);
44a8736bd20a08 Darrick J. Wong 2018-07-25 1123 xfs_irele(ip);
58c904734cd091 Dave Chinner 2015-02-23 1124 }
f2f7b9ff62a289 Darrick J. Wong 2021-01-27 1125 out_release_dquots:
c24b5dfadc4a4f Dave Chinner 2013-08-12 1126 xfs_qm_dqrele(udqp);
c24b5dfadc4a4f Dave Chinner 2013-08-12 1127 xfs_qm_dqrele(gdqp);
c24b5dfadc4a4f Dave Chinner 2013-08-12 1128 xfs_qm_dqrele(pdqp);
c24b5dfadc4a4f Dave Chinner 2013-08-12 1129
c24b5dfadc4a4f Dave Chinner 2013-08-12 1130 if (unlock_dp_on_error)
6552321831dce8 Christoph Hellwig 2016-11-30 1131 xfs_iunlock(dp, XFS_ILOCK_EXCL);
c24b5dfadc4a4f Dave Chinner 2013-08-12 1132 return error;
c24b5dfadc4a4f Dave Chinner 2013-08-12 1133 }
c24b5dfadc4a4f Dave Chinner 2013-08-12 1134
:::::: The code at line 1010 was first introduced by commit
:::::: b5a08423da9da59c7f38ed8dbb6dd6cbbe9024a4 xfs: fix quota accounting when a mount is
idmapped
:::::: TO: Darrick J. Wong <djwong(a)kernel.org>
:::::: CC: Darrick J. Wong <djwong(a)djwong.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org