atomic_set(&mfd->mfd_refcount, 2);
- INIT_LIST_HEAD(&mfd->mfd_handle.h_link);
- INIT_LIST_HEAD(&mfd->mfd_list);
+ CFS_INIT_LIST_HEAD(&mfd->mfd_handle.h_link);
+ CFS_INIT_LIST_HEAD(&mfd->mfd_list);
class_handle_hash(&mfd->mfd_handle, mds_mfd_addref);
return mfd;
struct mds_obd *mds = mds_req2mds(req);
struct obd_device *obd = req->rq_export->exp_obd;
struct mds_file_data *mfd = NULL;
- struct lov_mds_md *lmm; /* object IDs created */
+ struct lov_mds_md *lmm = NULL; /* object IDs created */
int rc = 0;
ENTRY;
}
/* Step 2: Lookup the child */
-
+
if (!(lustre_msg_get_flags(req->rq_reqmsg) & MSG_REPLAY) &&
(rec->ur_flags & MDS_OPEN_LOCK) && (rec->ur_namelen == 1)) {
/* hack for nfsd with no_subtree_check, it will use anon
* dentry w/o filename to open the file. the anon dentry's
* parent was set to itself, so rec->ur_fid1 is the file.
* And in MDC it cannot derive the dentry's parent dentry,
- * hence the file's name, so we hack here in MDS,
+ * hence the file's name, so we hack here in MDS,
* refer to bug 13030. */
dchild = mds_fid2dentry(mds, rec->ur_fid1, NULL);
} else {
inode->i_nlink, mds_orphan_open_count(inode));
last_orphan = mds_orphan_open_dec_test(inode) &&
- mds_inode_is_orphan(inode);
- MDS_UP_WRITE_ORPHAN_SEM(inode);
+ mds_inode_is_orphan(inode);
/* this is half of the actual "close" */
if (mfd->mfd_mode & FMODE_WRITE) {
} else if (mfd->mfd_mode & MDS_FMODE_EXEC) {
mds_allow_write_access(inode);
}
+ /* here writecount change also needs protection from orphan write sem.
+ * so drop orphan write sem after mds_put_write_access, bz 12888. */
+ MDS_UP_WRITE_ORPHAN_SEM(inode);
if (last_orphan && unlink_orphan) {
int stripe_count = 0;