static int _ldlm_convert(struct ptlrpc_service *svc, struct ptlrpc_request *req)
{
- struct ldlm_request *dlm_req, *dlm_rep;
+ struct ldlm_request *dlm_req;
+ struct ldlm_reply *dlm_rep;
struct ldlm_resource *res;
int rc, size = sizeof(*dlm_rep);
ENTRY;
static void __exit ldlm_exit(void)
{
obd_unregister_type(OBD_LDLM_DEVICENAME);
- kmem_cache_destroy(ldlm_resource_slab);
- kmem_cache_destroy(ldlm_lock_slab);
+ if (kmem_cache_destroy(ldlm_resource_slab) != 0)
+ CERROR("couldn't free ldlm resource slab\n");
+ if (kmem_cache_destroy(ldlm_lock_slab) != 0)
+ CERROR("couldn't free ldlm lock slab\n");
}
EXPORT_SYMBOL(ldlm_local_lock_match);
GOTO(out, rc);
}
body = lustre_msg_buf(request->rq_repmsg, 0);
+ md.obdo = obdo;
} else {
request = it->it_data;
body = lustre_msg_buf(request->rq_repmsg, 1);
+ md.obdo = NULL;
}
body->valid = (__u32)OBD_MD_FLNOTOBD;
body->mode = mode;
md.body = body;
- md.obdo = obdo;
inode = iget4(dir->i_sb, body->ino, ll_find_inode, &md);
if (IS_ERR(inode)) {
if (id == 0) {
CERROR("fatal: invalid object #0\n");
+ LBUG();
RETURN(ERR_PTR(-ESTALE));
}
dentry = filter_fid2dentry(obddev,
filter_parent(obddev, S_IFREG),
o->ioo_id, S_IFREG);
+ if (IS_ERR(dentry))
+ GOTO(out_ctxt, rc = PTR_ERR(dentry));
inode = dentry->d_inode;
for (j = 0; j < o->ioo_bufcnt; j++, b++, r++) {
/* FIXME: we need to iput all inodes on error */
if (!inode)
- RETURN(-EINVAL);
+ GOTO(out_ctxt, rc = -EINVAL);
if (cmd == OBD_BRW_WRITE) {
page = filter_get_page_write(inode, index, r);
/* FIXME: we need to clean up here... */
if (IS_ERR(page))
- RETURN(PTR_ERR(page));
+ GOTO(out_ctxt, rc = PTR_ERR(page));
r->addr = page_address(page);
r->offset = b->offset;
list_for_each(tmp, &conn_list) {
c = list_entry(tmp, struct ptlrpc_connection, c_link);
if (memcmp(peer, &c->c_peer, sizeof(*peer)) == 0) {
- atomic_inc(&c->c_refcount);
+ ptlrpc_connection_addref(c);
GOTO(out, c);
}
}
list_for_each_safe(tmp, pos, &conn_unused_list) {
c = list_entry(tmp, struct ptlrpc_connection, c_link);
if (memcmp(peer, &c->c_peer, sizeof(*peer)) == 0) {
- atomic_inc(&c->c_refcount);
+ ptlrpc_connection_addref(c);
list_del(&c->c_link);
list_add(&c->c_link, &conn_list);
GOTO(out, c);
c->c_generation = 1;
c->c_epoch = 1;
c->c_bootcount = 0;
- atomic_set(&c->c_refcount, 1);
+ atomic_set(&c->c_refcount, 0);
+ ptlrpc_connection_addref(c);
spin_lock_init(&c->c_lock);
memcpy(&c->c_peer, peer, sizeof(c->c_peer));
int rc = 0;
ENTRY;
+ CDEBUG(D_INFO, "connection=%p\n", c);
if (atomic_dec_and_test(&c->c_refcount)) {
spin_lock(&conn_lock);
list_del(&c->c_link);
rc = 1;
}
if (atomic_read(&c->c_refcount) < 0)
- CERROR("refcount < 0!\n");
+ CERROR("refcount < 0 for connection %p!\n", c);
RETURN(rc);
}
struct ptlrpc_connection *ptlrpc_connection_addref(struct ptlrpc_connection *c)
{
ENTRY;
+ CDEBUG(D_INFO, "connection=%p\n", c);
atomic_inc(&c->c_refcount);
RETURN(c);
}
writeme
mcreate
tchmod
+toexcl
fsx
umount /mnt/lustre
mount -t lustre_lite -o ost=5,mds=6 none /mnt/lustre
-touch /mnt/lustre/bar
-touch /mnt/lustre/bar2
+touch /mnt/lustre/bar5
+touch /mnt/lustre/bar6
+touch /mnt/lustre/bar5
-touch /mnt/lustre/bar
+umount /mnt/lustre
+mount -t lustre_lite -o ost=5,mds=6 none /mnt/lustre
+
+touch /mnt/lustre/bar5
+
+umount /mnt/lustre
+mount -t lustre_lite -o ost=5,mds=6 none /mnt/lustre
+
+echo "ready debugger"
+read
+
+echo foo >> /mnt/lustre/bar
umount /mnt/lustre
mount -t lustre_lite -o ost=5,mds=6 none /mnt/lustre
-touch /mnt/lustre/bar
+cat /mnt/lustre/bar
exit;
-echo foo >> /mnt/lustre/bar
+echo foo >> /mnt/lustre/iotest
+echo bar >> /mnt/lustre/iotest
+cat /mnt/lustre/iotest
+
+umount /mnt/lustre
+mount -t lustre_lite -o ost=5,mds=6 none /mnt/lustre
+
+cat /mnt/lustre/iotest
+echo baz >> /mnt/lustre/iotest
umount /mnt/lustre
mount -t lustre_lite -o ost=5,mds=6 none /mnt/lustre
ls /mnt/lustre
mkdir /mnt/lustre/newer
ls /mnt/lustre
+
+umount /mnt/lustre
+mount -t lustre_lite -o ost=5,mds=6 none /mnt/lustre
+
+cat /mnt/lustre/iotest
\ No newline at end of file
TIME=`date +'%s'`
-$DBGCTL debug_kernel /tmp/debug.1.$TIME
+$DBGCTL debug_kernel /tmp/debug.1.$TIME 1
if mount | grep '/mnt/lustre'; then
umount /mnt/lustre || fail "cannot unmount"
rmmod obdclass
rmmod extN
-$DBGCTL debug_kernel /tmp/debug.2.$TIME
+$DBGCTL debug_kernel /tmp/debug.2.$TIME 1
$PTLCTL <<EOF
setup tcp