IS_IMMUTABLE(dentry->d_inode))
GOTO(out, rc = -EPERM);
- /* NOTE: This might need to go outside i_mutex, though it isn't clear if
- * that was done because of journal_start (which is already done
- * here) or some other ordering issue. */
+ /* Locking order: i_mutex -> journal_lock -> dqptr_sem. LU-952 */
ll_vfs_dq_init(dir);
rc = ll_security_inode_unlink(dir, dentry, mnt);
*fcc = oa->o_lcookie;
}
if (ia_valid & (ATTR_SIZE | ATTR_UID | ATTR_GID)) {
- ll_vfs_dq_init(inode);
/* Filter truncates and writes are serialized by
* i_alloc_sem, see the comment in
* filter_preprw_write.*/
GOTO(out_unlock, rc = PTR_ERR(handle));
}
+ /* Locking order: i_mutex -> journal_lock -> dqptr_sem. LU-952 */
+ if (ia_valid & (ATTR_SIZE | ATTR_UID | ATTR_GID))
+ ll_vfs_dq_init(inode);
+
if (oa->o_valid & OBD_MD_FLFLAGS) {
rc = fsfilt_iocontrol(exp->exp_obd, dentry,
FSFILT_IOC_SETFLAGS, (long)&oa->o_flags);
if (fcc != NULL)
*fcc = oa->o_lcookie;
}
- ll_vfs_dq_init(dchild->d_inode);
/* we're gonna truncate it first in order to avoid possible deadlock:
* P1 P2
GOTO(cleanup, rc = PTR_ERR(handle));
}
+ /* Locking order: i_mutex -> journal_lock -> dqptr_sem. LU-952 */
+ ll_vfs_dq_init(dchild->d_inode);
+
iattr.ia_valid = ATTR_SIZE;
iattr.ia_size = 0;
rc = fsfilt_setattr(obd, dchild, handle, &iattr, 1);
push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
cleanup_phase = 2;
- ll_vfs_dq_init(inode);
fsfilt_check_slow(obd, now, "quota init");
retry:
fsfilt_check_slow(obd, now, "brw_start");
+ /* Locking order: i_mutex -> journal_lock -> dqptr_sem. LU-952 */
+ ll_vfs_dq_init(inode);
+
i = OBD_MD_FLATIME | OBD_MD_FLMTIME | OBD_MD_FLCTIME;
/* If the inode still has SUID+SGID bits set (see filter_precreate())