tree: https://github.com/ceph/ceph-client.git testing head: d61e20b0016b1c3a75e7997adafa9db1683b6557 commit: d61e20b0016b1c3a75e7997adafa9db1683b6557 [3/3] ceph: restore ctime as well in the case of restoring old mode config: xtensa-allyesconfig (attached as .config) compiler: xtensa-linux-gcc (GCC) 8.1.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git checkout d61e20b0016b1c3a75e7997adafa9db1683b6557 # save the attached .config to linux build tree GCC_VERSION=8.1.0 make.cross ARCH=xtensa All errors (new ones prefixed by >>): fs//ceph/acl.c: In function 'ceph_set_acl': >> fs//ceph/acl.c:104:32: error: invalid initializer struct timespec64 old_ctime = inode->i_ctime; ^~~~~ >> fs//ceph/acl.c:158:22: error: incompatible types when assigning to type 'struct timespec' from type 'struct timespec64' newattrs.ia_ctime = old_ctime; ^ vim +104 fs//ceph/acl.c 97 98 int ceph_set_acl(struct inode *inode, struct posix_acl *acl, int type) 99 { 100 int ret = 0, size = 0; 101 const char *name = NULL; 102 char *value = NULL; 103 struct iattr newattrs; > 104 struct timespec64 old_ctime = inode->i_ctime; 105 umode_t new_mode = inode->i_mode, old_mode = inode->i_mode; 106 107 switch (type) { 108 case ACL_TYPE_ACCESS: 109 name = XATTR_NAME_POSIX_ACL_ACCESS; 110 if (acl) { 111 ret = posix_acl_update_mode(inode, &new_mode, &acl); 112 if (ret) 113 goto out; 114 } 115 break; 116 case ACL_TYPE_DEFAULT: 117 if (!S_ISDIR(inode->i_mode)) { 118 ret = acl ? -EINVAL : 0; 119 goto out; 120 } 121 name = XATTR_NAME_POSIX_ACL_DEFAULT; 122 break; 123 default: 124 ret = -EINVAL; 125 goto out; 126 } 127 128 if (acl) { 129 size = posix_acl_xattr_size(acl->a_count); 130 value = kmalloc(size, GFP_NOFS); 131 if (!value) { 132 ret = -ENOMEM; 133 goto out; 134 } 135 136 ret = posix_acl_to_xattr(&init_user_ns, acl, value, size); 137 if (ret < 0) 138 goto out_free; 139 } 140 141 if (ceph_snap(inode) != CEPH_NOSNAP) { 142 ret = -EROFS; 143 goto out_free; 144 } 145 146 if (new_mode != old_mode) { 147 newattrs.ia_ctime = current_time(inode); 148 newattrs.ia_mode = new_mode; 149 newattrs.ia_valid = ATTR_MODE | ATTR_CTIME; 150 ret = __ceph_setattr(inode, &newattrs); 151 if (ret) 152 goto out_free; 153 } 154 155 ret = __ceph_setxattr(inode, name, value, size, 0); 156 if (ret) { 157 if (new_mode != old_mode) { > 158 newattrs.ia_ctime = old_ctime; 159 newattrs.ia_mode = old_mode; 160 newattrs.ia_valid = ATTR_MODE | ATTR_CTIME; 161 __ceph_setattr(inode, &newattrs); 162 } 163 goto out_free; 164 } 165 166 ceph_set_cached_acl(inode, type, acl); 167 168 out_free: 169 kfree(value); 170 out: 171 return ret; 172 } 173 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip