tree: https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git work.dcache head: 1550f79a78b3956a5026f8a7c576de2c1d11f509 commit: 5ee99702db84422642826a7b44895e0d7593de0d [15/23] dcache.c: trim includes config: score-spct6600_defconfig (attached as .config) compiler: score-elf-gcc (GCC) 4.9.4 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git checkout 5ee99702db84422642826a7b44895e0d7593de0d # save the attached .config to linux build tree make.cross ARCH=score Note: the vfs/work.dcache HEAD 1550f79a78b3956a5026f8a7c576de2c1d11f509 builds fine. It only hurts bisectibility. All errors (new ones prefixed by >>): fs/dcache.c: In function 'prepend_path': >> fs/dcache.c:3188:3: error: implicit declaration of function 'prefetch' [-Werror=implicit-function-declaration] prefetch(parent); ^ cc1: some warnings being treated as errors vim +/prefetch +3188 fs/dcache.c cdd16d026 Miklos Szeredi 2008-06-23 3121 ^1da177e4 Linus Torvalds 2005-04-16 3122 /** 208898c17 Randy Dunlap 2010-11-18 3123 * prepend_path - Prepend path string to a buffer 9d1bc6013 Miklos Szeredi 2008-03-27 3124 * @path: the dentry/vfsmount to report 02125a826 Al Viro 2011-12-05 3125 * @root: root vfsmnt/dentry f2eb6575d Miklos Szeredi 2010-08-10 3126 * @buffer: pointer to the end of the buffer f2eb6575d Miklos Szeredi 2010-08-10 3127 * @buflen: pointer to buffer length ^1da177e4 Linus Torvalds 2005-04-16 3128 * 181299772 Waiman Long 2013-09-12 3129 * The function will first try to write out the pathname without taking any 181299772 Waiman Long 2013-09-12 3130 * lock other than the RCU read lock to make sure that dentries won't go away. 181299772 Waiman Long 2013-09-12 3131 * It only checks the sequence number of the global rename_lock as any change 181299772 Waiman Long 2013-09-12 3132 * in the dentry's d_seq will be preceded by changes in the rename_lock 181299772 Waiman Long 2013-09-12 3133 * sequence number. If the sequence number had been changed, it will restart 181299772 Waiman Long 2013-09-12 3134 * the whole pathname back-tracing sequence again by taking the rename_lock. 181299772 Waiman Long 2013-09-12 3135 * In this case, there is no need to take the RCU read lock as the recursive 181299772 Waiman Long 2013-09-12 3136 * parent pointer references will keep the dentry chain alive as long as no 181299772 Waiman Long 2013-09-12 3137 * rename operation is performed. ^1da177e4 Linus Torvalds 2005-04-16 3138 */ 02125a826 Al Viro 2011-12-05 3139 static int prepend_path(const struct path *path, 02125a826 Al Viro 2011-12-05 3140 const struct path *root, f2eb6575d Miklos Szeredi 2010-08-10 3141 char **buffer, int *buflen) ^1da177e4 Linus Torvalds 2005-04-16 3142 { ede4cebce Al Viro 2013-11-13 3143 struct dentry *dentry; ede4cebce Al Viro 2013-11-13 3144 struct vfsmount *vfsmnt; ede4cebce Al Viro 2013-11-13 3145 struct mount *mnt; f2eb6575d Miklos Szeredi 2010-08-10 3146 int error = 0; 48a066e72 Al Viro 2013-09-29 3147 unsigned seq, m_seq = 0; 232d2d60a Waiman Long 2013-09-09 3148 char *bptr; 232d2d60a Waiman Long 2013-09-09 3149 int blen; 6092d0481 Ram Pai 2008-03-27 3150 48f5ec21d Al Viro 2013-09-09 3151 rcu_read_lock(); 48a066e72 Al Viro 2013-09-29 3152 restart_mnt: 48a066e72 Al Viro 2013-09-29 3153 read_seqbegin_or_lock(&mount_lock, &m_seq); 48a066e72 Al Viro 2013-09-29 3154 seq = 0; 4ec6c2aea Li Zhong 2013-11-13 3155 rcu_read_lock(); 232d2d60a Waiman Long 2013-09-09 3156 restart: 232d2d60a Waiman Long 2013-09-09 3157 bptr = *buffer; 232d2d60a Waiman Long 2013-09-09 3158 blen = *buflen; 48a066e72 Al Viro 2013-09-29 3159 error = 0; ede4cebce Al Viro 2013-11-13 3160 dentry = path->dentry; ede4cebce Al Viro 2013-11-13 3161 vfsmnt = path->mnt; ede4cebce Al Viro 2013-11-13 3162 mnt = real_mount(vfsmnt); 232d2d60a Waiman Long 2013-09-09 3163 read_seqbegin_or_lock(&rename_lock, &seq); f2eb6575d Miklos Szeredi 2010-08-10 3164 while (dentry != root->dentry || vfsmnt != root->mnt) { ^1da177e4 Linus Torvalds 2005-04-16 3165 struct dentry * parent; ^1da177e4 Linus Torvalds 2005-04-16 3166 ^1da177e4 Linus Torvalds 2005-04-16 3167 if (dentry == vfsmnt->mnt_root || IS_ROOT(dentry)) { 66702eb59 Mark Rutland 2017-10-23 3168 struct mount *parent = READ_ONCE(mnt->mnt_parent); cde93be45 Eric W. Biederman 2015-08-15 3169 /* Escaped? */ cde93be45 Eric W. Biederman 2015-08-15 3170 if (dentry != vfsmnt->mnt_root) { cde93be45 Eric W. Biederman 2015-08-15 3171 bptr = *buffer; cde93be45 Eric W. Biederman 2015-08-15 3172 blen = *buflen; cde93be45 Eric W. Biederman 2015-08-15 3173 error = 3; cde93be45 Eric W. Biederman 2015-08-15 3174 break; cde93be45 Eric W. Biederman 2015-08-15 3175 } 552ce544e Linus Torvalds 2007-02-13 3176 /* Global root? */ 48a066e72 Al Viro 2013-09-29 3177 if (mnt != parent) { 66702eb59 Mark Rutland 2017-10-23 3178 dentry = READ_ONCE(mnt->mnt_mountpoint); 48a066e72 Al Viro 2013-09-29 3179 mnt = parent; 0714a5338 Al Viro 2011-11-24 3180 vfsmnt = &mnt->mnt; ^1da177e4 Linus Torvalds 2005-04-16 3181 continue; ^1da177e4 Linus Torvalds 2005-04-16 3182 } 02125a826 Al Viro 2011-12-05 3183 if (!error) f7a99c5b7 Al Viro 2012-06-09 3184 error = is_mounted(vfsmnt) ? 1 : 2; 232d2d60a Waiman Long 2013-09-09 3185 break; 232d2d60a Waiman Long 2013-09-09 3186 } 232d2d60a Waiman Long 2013-09-09 3187 parent = dentry->d_parent; 232d2d60a Waiman Long 2013-09-09 @3188 prefetch(parent); 232d2d60a Waiman Long 2013-09-09 3189 error = prepend_name(&bptr, &blen, &dentry->d_name); 232d2d60a Waiman Long 2013-09-09 3190 if (error) 232d2d60a Waiman Long 2013-09-09 3191 break; 232d2d60a Waiman Long 2013-09-09 3192 232d2d60a Waiman Long 2013-09-09 3193 dentry = parent; 232d2d60a Waiman Long 2013-09-09 3194 } 48f5ec21d Al Viro 2013-09-09 3195 if (!(seq & 1)) 48f5ec21d Al Viro 2013-09-09 3196 rcu_read_unlock(); 48f5ec21d Al Viro 2013-09-09 3197 if (need_seqretry(&rename_lock, seq)) { 48f5ec21d Al Viro 2013-09-09 3198 seq = 1; 232d2d60a Waiman Long 2013-09-09 3199 goto restart; 48f5ec21d Al Viro 2013-09-09 3200 } 48f5ec21d Al Viro 2013-09-09 3201 done_seqretry(&rename_lock, seq); 4ec6c2aea Li Zhong 2013-11-13 3202 4ec6c2aea Li Zhong 2013-11-13 3203 if (!(m_seq & 1)) 4ec6c2aea Li Zhong 2013-11-13 3204 rcu_read_unlock(); 48a066e72 Al Viro 2013-09-29 3205 if (need_seqretry(&mount_lock, m_seq)) { 48a066e72 Al Viro 2013-09-29 3206 m_seq = 1; 48a066e72 Al Viro 2013-09-29 3207 goto restart_mnt; 48a066e72 Al Viro 2013-09-29 3208 } 48a066e72 Al Viro 2013-09-29 3209 done_seqretry(&mount_lock, m_seq); 232d2d60a Waiman Long 2013-09-09 3210 232d2d60a Waiman Long 2013-09-09 3211 if (error >= 0 && bptr == *buffer) { 232d2d60a Waiman Long 2013-09-09 3212 if (--blen < 0) 232d2d60a Waiman Long 2013-09-09 3213 error = -ENAMETOOLONG; 232d2d60a Waiman Long 2013-09-09 3214 else 232d2d60a Waiman Long 2013-09-09 3215 *--bptr = '/'; 232d2d60a Waiman Long 2013-09-09 3216 } 232d2d60a Waiman Long 2013-09-09 3217 *buffer = bptr; 232d2d60a Waiman Long 2013-09-09 3218 *buflen = blen; 7ea600b53 Al Viro 2013-03-26 3219 return error; f2eb6575d Miklos Szeredi 2010-08-10 3220 } be285c712 Andreas Gruenbacher 2008-06-16 3221 :::::: The code at line 3188 was first introduced by commit :::::: 232d2d60aa5469bb097f55728f65146bd49c1d25 dcache: Translating dentry into pathname without taking rename_lock :::::: TO: Waiman Long <Waiman.Long@xxxxxx> :::::: CC: Al Viro <viro@xxxxxxxxxxxxxxxxxx> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip