if (rc != 0)
RETURN(rc);
+ spin_lock(&inode->i_lock);
set_nlink(inode, attr.cat_nlink);
+ spin_unlock(&inode->i_lock);
+
inode->i_blocks = attr.cat_blocks;
i_size_write(inode, attr.cat_size);
inode->i_gid = make_kgid(&init_user_ns, body->mbo_gid);
if (body->mbo_valid & OBD_MD_FLPROJID)
lli->lli_projid = body->mbo_projid;
- if (body->mbo_valid & OBD_MD_FLNLINK)
+ if (body->mbo_valid & OBD_MD_FLNLINK) {
+ spin_lock(&inode->i_lock);
set_nlink(inode, body->mbo_nlink);
+ spin_unlock(&inode->i_lock);
+ }
if (body->mbo_valid & OBD_MD_FLRDEV)
inode->i_rdev = old_decode_dev(body->mbo_rdev);
* immediately.
*/
body = req_capsule_server_get(&request->rq_pill, &RMF_MDT_BODY);
- if (body->mbo_valid & OBD_MD_FLNLINK)
+ if (body->mbo_valid & OBD_MD_FLNLINK) {
+ spin_lock(&dchild->d_inode->i_lock);
set_nlink(dchild->d_inode, body->mbo_nlink);
+ spin_unlock(&dchild->d_inode->i_lock);
+ }
}
ptlrpc_req_finished(request);
* the link count so the inode can be freed immediately.
*/
body = req_capsule_server_get(&request->rq_pill, &RMF_MDT_BODY);
- if (body->mbo_valid & OBD_MD_FLNLINK)
+ if (body->mbo_valid & OBD_MD_FLNLINK) {
+ spin_lock(&dchild->d_inode->i_lock);
set_nlink(dchild->d_inode, body->mbo_nlink);
+ spin_unlock(&dchild->d_inode->i_lock);
+ }
ll_update_times(request, dir);
i_size_write(inode, body->mbo_size);
inode->i_blocks = body->mbo_blocks;
+ spin_lock(&inode->i_lock);
set_nlink(inode, body->mbo_nlink);
+ spin_unlock(&inode->i_lock);
inode->i_atime.tv_sec = body->mbo_atime;
inode->i_ctime.tv_sec = body->mbo_ctime;
inode->i_mtime.tv_sec = body->mbo_mtime;