Skip to content
Snippets Groups Projects
Commit 78dfeefe authored by Mike Shaver's avatar Mike Shaver
Browse files

Instrumentation for reproducing and verifying 1897 (open-count leaked if close

is interrupted on the client). r=robert.
parent 47c321cf
No related merge requests found
......@@ -258,6 +258,8 @@ struct mds_obd {
struct file *mds_lov_objid_filp;
unsigned long *mds_client_bitmap;
struct semaphore mds_orphan_recovery_sem;
atomic_t mds_open_count;
};
struct echo_obd {
......
......@@ -1301,6 +1301,7 @@ static int mds_setup(struct obd_device *obd, obd_count len, void *buf)
spin_lock_init(&mds->mds_transno_lock);
mds->mds_max_mdsize = sizeof(struct lov_mds_md);
mds->mds_max_cookiesize = sizeof(struct llog_cookie);
atomic_set(&mds->mds_open_count, 0);
obd->obd_namespace = ldlm_namespace_new("mds_server",
LDLM_NAMESPACE_SERVER);
......
......@@ -49,6 +49,17 @@ static int lprocfs_mds_rd_mntdev(char *page, char **start, off_t off, int count,
return snprintf(page, count, "%s\n",obd->u.mds.mds_vfsmnt->mnt_devname);
}
static int lprocfs_mds_rd_filesopen(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
struct obd_device *obd = data;
LASSERT(obd != NULL);
*eof = 1;
return snprintf(page, count, "%d\n",
atomic_read(&obd->u.mds.mds_open_count));
}
static int lprocfs_mds_rd_recovery_status(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
......@@ -150,6 +161,7 @@ struct lprocfs_vars lprocfs_mds_obd_vars[] = {
{ "fstype", lprocfs_rd_fstype, 0, 0 },
{ "filestotal", lprocfs_rd_filestotal, 0, 0 },
{ "filesfree", lprocfs_rd_filesfree, 0, 0 },
{ "filesopen", lprocfs_mds_rd_filesopen, 0, 0 },
//{ "filegroups", lprocfs_rd_filegroups, 0, 0 },
{ "mntdev", lprocfs_mds_rd_mntdev, 0, 0 },
{ "recovery_status", lprocfs_mds_rd_recovery_status, 0, 0 },
......
......@@ -963,6 +963,8 @@ int mds_open(struct mds_update_record *rec, int offset,
else
ldlm_put_lock_into_req(req, &parent_lockh, parent_mode);
}
if (rc == 0)
atomic_inc(&mds->mds_open_count);
RETURN(rc);
}
......@@ -1085,6 +1087,7 @@ int mds_mfd_close(struct ptlrpc_request *req, struct obd_device *obd,
mds_mfd_destroy(mfd);
cleanup:
atomic_dec(&mds->mds_open_count);
if (req) {
rc = mds_finish_transno(mds, pending_dir, handle, req, rc, 0);
} else if (handle) {
......
#!/bin/sh
LUSTRE=`dirname $0`/..
exec >> /tmp/recovery-`hostname`.log
exec 2>&1
$LUSTRE/utils/lconf --recover --verbose --tgt_uuid $2 --client_uuid $3 --conn_uuid $4 $LUSTRE/tests/local.xml
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment