LBUG();
fd = kmem_cache_alloc(ll_file_data_slab, SLAB_KERNEL);
- if (!fd) {
- rc = -ENOMEM;
- goto out;
+ if (!fd)
+ GOTO(out, rc = -ENOMEM);
+ memset(fd, 0, sizeof(*fd));
+
+ rc = mdc_open(&sbi->ll_mds_client, inode->i_ino, S_IFREG,
+ file->f_flags, &fd->fd_mdshandle, &req);
+ if (!fd->fd_mdshandle)
+ CERROR("mdc_open didn't assign fd_mdshandle\n");
+
+ ptlrpc_free_req(req);
+ if (rc) {
+ if (rc > 0)
+ rc = -rc;
+ GOTO(out, rc);
}
oa = ll_oa_from_inode(inode, (OBD_MD_FLMODE | OBD_MD_FLID));
LBUG();
rc = obd_open(ll_i2obdconn(inode), oa);
obdo_free(oa);
- if (rc) {
+ if (rc) {
+ /* XXX: Need to do mdc_close here! */
if (rc > 0)
rc = -rc;
- EXIT;
- goto out;
+ GOTO(out, rc);
}
- rc = mdc_open(&sbi->ll_mds_client, inode->i_ino, S_IFREG,
- file->f_flags, &fd->fd_mdshandle, &req);
- if (!fd->fd_mdshandle)
- LBUG();
-
- ptlrpc_free_req(req);
- if (rc) {
- if (rc > 0)
- rc = -rc;
- EXIT;
- goto out;
- }
file->private_data = fd;
EXIT;
out:
- if (rc && fd)
+ if (rc && fd) {
kmem_cache_free(ll_file_data_slab, fd);
+ file->private_data = NULL;
+ }
return rc;
}
-
static int ll_file_release(struct inode *inode, struct file *file)
{
int rc;
fd = (struct ll_file_data *)file->private_data;
if (!fd || !fd->fd_mdshandle) {
LBUG();
- rc = -EINVAL;
- goto out;
+ GOTO(out, rc = -EINVAL);
}
oa = ll_oa_from_inode(inode, (OBD_MD_FLMODE | OBD_MD_FLID));
if (rc) {
if (rc > 0)
rc = -rc;
- EXIT;
- goto out;
+ GOTO(out, rc);
}
iattr.ia_valid = ATTR_SIZE;
if (rc) {
if (rc > 0)
rc = -rc;
- EXIT;
- goto out;
+ GOTO(out, rc);
}
EXIT;
$* &
sleep 1
kill -9 $!
+
+ echo 0 > /proc/sys/lustre/fail_loc
+ umount /mnt/obd
+ mount -t lustre_light -o device=3 none /mnt/obd
}
mknod /dev/request c 10 244
+sh llmount.sh
+
# GETATTR_NET - ls will hang on the getattr
-run 0x102 ls /mnt/obd/lost+found
+run 0x102 ls -l /mnt/obd
# READPAGE_NET - ls will hang reading in new pages (lost+found is not in cache)
-run 0x104 ls /mnt/obd/lost+found
+run 0x104 ls /mnt/obd
sleep 1
run 0x107 touch /mnt/obd/tt
# REINT_NET - mv will hang on rename
-run 0x107 mv /mnt/obd/lost+found /mnt/obd/lost
+touch /mnt/obd/foo
+run 0x107 mv /mnt/obd/foo /mnt/obd/bar
# REINT_NET - rm will hang on unlink
-run 0x107 rmdir /mnt/obd/lost+found
+touch /mnt/obd/salmon
+run 0x107 rm /mnt/obd/salmon
# OPEN_NET - touch will hang on open
-run 0x113 touch /mnt/obd/foo
+touch /mnt/obd/foo
+run 0x113 cat /mnt/obd/foo
# CLOSE_NET - ls will hang on close
run 0x115 ./testreq --close junk_file_handle