From 9b76b9f1b9512903df9070cb485d02d66683d691 Mon Sep 17 00:00:00 2001 From: adilger Date: Thu, 18 Mar 2004 00:14:36 +0000 Subject: [PATCH] Don't assert bitmap for free of self-export, it might not exist in errors. Don't leak a dentry reference during iopen setup error. b=2936 --- lustre/mds/mds_fs.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lustre/mds/mds_fs.c b/lustre/mds/mds_fs.c index ad8cadc..774e72b 100644 --- a/lustre/mds/mds_fs.c +++ b/lustre/mds/mds_fs.c @@ -127,7 +127,6 @@ int mds_client_free(struct obd_export *exp, int clear_client) int rc; unsigned long *bitmap = mds->mds_client_bitmap; - LASSERT(bitmap); if (!med->med_mcd) RETURN(0); @@ -138,6 +137,8 @@ int mds_client_free(struct obd_export *exp, int clear_client) CDEBUG(D_INFO, "freeing client at idx %u (%lld)with UUID '%s'\n", med->med_idx, med->med_off, med->med_mcd->mcd_uuid); + LASSERT(bitmap); + /* Clear the bit _after_ zeroing out the client so we don't race with mds_client_add and zero out new clients.*/ if (!test_bit(med->med_idx, bitmap)) { @@ -402,11 +403,16 @@ int mds_fs_setup(struct obd_device *obd, struct vfsmount *mnt) dentry = lookup_one_len("__iopen__", current->fs->pwd, strlen("__iopen__")); - if (IS_ERR(dentry) || !dentry->d_inode) { - rc = (IS_ERR(dentry)) ? PTR_ERR(dentry): -ENOENT; - CERROR("cannot open iopen FH directory: rc = %d\n", rc); + if (IS_ERR(dentry)) { + rc = PTR_ERR(dentry); + CERROR("cannot lookup __iopen__ directory: rc = %d\n", rc); GOTO(err_pop, rc); } + if (!dentry->d_inode) { + rc = -ENOENT; + CERROR("__iopen__ directory has no inode? rc = %d\n", rc); + GOTO(err_fid, rc); + } mds->mds_fid_de = dentry; dentry = simple_mkdir(current->fs->pwd, "PENDING", 0777, 1); -- 1.8.3.1