Description: test_7 on sanity-quota.sh can't be used on separate machines
Details : add facet to handle it
+Severity : normal
+Bugzilla : 13030
+Description: "ll_intent_file_open()) lock enqueue: err: -13" with nfs
+Details : with NFS, the anon dentry's parent was set to itself in
+ d_alloc_anon(), so in MDS, we use rec->ur_fid1 to find the
+ corresponding dentry other than use rec->ur_name.
+
--------------------------------------------------------------------------------
2007-08-27 Cluster File Systems, Inc. <info@clusterfs.com>
int eadatalen = 0, rc;
struct inode *inode = NULL;
struct ll_fid iid = { .id = ino, .generation = generation };
+ ENTRY;
inode = ILOOKUP(sb, ino, ll_nfs_test_inode, &iid);
if (inode)
- return inode;
+ RETURN(inode);
if (S_ISREG(mode)) {
rc = ll_get_max_mdsize(sbi, &eadatalen);
if (rc)
- return ERR_PTR(rc);
+ RETURN(ERR_PTR(rc));
valid |= OBD_MD_FLEASIZE;
}
fid.id = (__u64)ino;
rc = mdc_getattr(sbi->ll_mdc_exp, &fid, valid, eadatalen, &req);
if (rc) {
CERROR("failure %d inode %lu\n", rc, ino);
- return ERR_PTR(rc);
+ RETURN(ERR_PTR(rc));
}
rc = ll_prep_inode(sbi->ll_osc_exp, &inode, req, REPLY_REC_OFF, sb);
if (rc) {
ptlrpc_req_finished(req);
- return ERR_PTR(rc);
+ RETURN(ERR_PTR(rc));
}
ptlrpc_req_finished(req);
- return inode;
+ RETURN(inode);
}
extern struct dentry_operations ll_d_ops;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
struct list_head *lp;
#endif
+ ENTRY;
if (ino == 0)
- return ERR_PTR(-ESTALE);
+ RETURN(ERR_PTR(-ESTALE));
inode = search_inode_for_lustre(sb, ino, generation, mode);
if (IS_ERR(inode)) {
- return ERR_PTR(PTR_ERR(inode));
+ RETURN(ERR_PTR(PTR_ERR(inode)));
}
if (is_bad_inode(inode) ||
(generation && inode->i_generation != generation)){
atomic_read(&inode->i_count), inode->i_generation,
generation);
iput(inode);
- return ERR_PTR(-ESTALE);
+ RETURN(ERR_PTR(-ESTALE));
}
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
result = d_alloc_anon(inode);
if (!result) {
iput(inode);
- return ERR_PTR(-ENOMEM);
+ RETURN(ERR_PTR(-ENOMEM));
}
#else
/* now to find a dentry.
unlock_dentry(result);
spin_unlock(&dcache_lock);
iput(inode);
- return result;
+ RETURN(result);
}
unlock_dentry(result);
}
result = d_alloc_root(inode);
if (result == NULL) {
iput(inode);
- return ERR_PTR(-ENOMEM);
+ RETURN(ERR_PTR(-ENOMEM));
}
result->d_flags |= DCACHE_DISCONNECTED;
#endif
ll_set_dd(result);
result->d_op = &ll_d_ops;
- return result;
+ RETURN(result);
}
struct dentry *ll_fh_to_dentry(struct super_block *sb, __u32 *data, int len,
}
/* Step 2: Lookup the child */
- dchild = ll_lookup_one_len(rec->ur_name, dparent, rec->ur_namelen - 1);
+
+ 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,
+ * refer to bug 13030. */
+ dchild = mds_fid2dentry(mds, rec->ur_fid1, NULL);
+ } else {
+ dchild = ll_lookup_one_len(rec->ur_name, dparent,
+ rec->ur_namelen - 1);
+ }
if (IS_ERR(dchild)) {
rc = PTR_ERR(dchild);
dchild = NULL; /* don't confuse mds_finish_transno() below */