tree: https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git work.dcache head: f700b37a0dc21ad5e0b5e8e947659f230fd4984c commit: b609ffae6e69afeb1955526ff06c57795964b362 [16/23] split d_path() and friends into a separate file 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 b609ffae6e69afeb1955526ff06c57795964b362 # save the attached .config to linux build tree make.cross ARCH=score All errors (new ones prefixed by >>): fs/d_path.c: In function 'prepend_path': >> fs/d_path.c:122:3: error: implicit declaration of function 'prefetch' [-Werror=implicit-function-declaration] prefetch(parent); ^ cc1: some warnings being treated as errors vim +/prefetch +122 fs/d_path.c 55 56 /** 57 * prepend_path - Prepend path string to a buffer 58 * @path: the dentry/vfsmount to report 59 * @root: root vfsmnt/dentry 60 * @buffer: pointer to the end of the buffer 61 * @buflen: pointer to buffer length 62 * 63 * The function will first try to write out the pathname without taking any 64 * lock other than the RCU read lock to make sure that dentries won't go away. 65 * It only checks the sequence number of the global rename_lock as any change 66 * in the dentry's d_seq will be preceded by changes in the rename_lock 67 * sequence number. If the sequence number had been changed, it will restart 68 * the whole pathname back-tracing sequence again by taking the rename_lock. 69 * In this case, there is no need to take the RCU read lock as the recursive 70 * parent pointer references will keep the dentry chain alive as long as no 71 * rename operation is performed. 72 */ 73 static int prepend_path(const struct path *path, 74 const struct path *root, 75 char **buffer, int *buflen) 76 { 77 struct dentry *dentry; 78 struct vfsmount *vfsmnt; 79 struct mount *mnt; 80 int error = 0; 81 unsigned seq, m_seq = 0; 82 char *bptr; 83 int blen; 84 85 rcu_read_lock(); 86 restart_mnt: 87 read_seqbegin_or_lock(&mount_lock, &m_seq); 88 seq = 0; 89 rcu_read_lock(); 90 restart: 91 bptr = *buffer; 92 blen = *buflen; 93 error = 0; 94 dentry = path->dentry; 95 vfsmnt = path->mnt; 96 mnt = real_mount(vfsmnt); 97 read_seqbegin_or_lock(&rename_lock, &seq); 98 while (dentry != root->dentry || vfsmnt != root->mnt) { 99 struct dentry * parent; 100 101 if (dentry == vfsmnt->mnt_root || IS_ROOT(dentry)) { 102 struct mount *parent = READ_ONCE(mnt->mnt_parent); 103 /* Escaped? */ 104 if (dentry != vfsmnt->mnt_root) { 105 bptr = *buffer; 106 blen = *buflen; 107 error = 3; 108 break; 109 } 110 /* Global root? */ 111 if (mnt != parent) { 112 dentry = READ_ONCE(mnt->mnt_mountpoint); 113 mnt = parent; 114 vfsmnt = &mnt->mnt; 115 continue; 116 } 117 if (!error) 118 error = is_mounted(vfsmnt) ? 1 : 2; 119 break; 120 } 121 parent = dentry->d_parent; > 122 prefetch(parent); 123 error = prepend_name(&bptr, &blen, &dentry->d_name); 124 if (error) 125 break; 126 127 dentry = parent; 128 } 129 if (!(seq & 1)) 130 rcu_read_unlock(); 131 if (need_seqretry(&rename_lock, seq)) { 132 seq = 1; 133 goto restart; 134 } 135 done_seqretry(&rename_lock, seq); 136 137 if (!(m_seq & 1)) 138 rcu_read_unlock(); 139 if (need_seqretry(&mount_lock, m_seq)) { 140 m_seq = 1; 141 goto restart_mnt; 142 } 143 done_seqretry(&mount_lock, m_seq); 144 145 if (error >= 0 && bptr == *buffer) { 146 if (--blen < 0) 147 error = -ENAMETOOLONG; 148 else 149 *--bptr = '/'; 150 } 151 *buffer = bptr; 152 *buflen = blen; 153 return error; 154 } 155 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip