From 931a2371586afbc838b4b7ab0044b2aecd4d3026 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 25 Feb 2009 19:51:15 +0000 Subject: [PATCH] - more error handling in ldiskfs osd --- lustre/osd/osd_handler.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lustre/osd/osd_handler.c b/lustre/osd/osd_handler.c index 7a6dcdd..0219aaa 100644 --- a/lustre/osd/osd_handler.c +++ b/lustre/osd/osd_handler.c @@ -3665,8 +3665,11 @@ static int osd_mount(const struct lu_env *env, o->od_mnt = ll_kern_mount("ldiskfs", s_flags, dev, (void *)options); /* XXX: error handling */ - if (IS_ERR(o->od_mnt)) - GOTO(out, rc = PTR_ERR(o->od_mnt)); + if (IS_ERR(o->od_mnt)) { + rc = PTR_ERR(o->od_mnt); + o->od_mnt = NULL; + GOTO(out, rc); + } o->od_fsops = fsfilt_get_ops(mt_str(LDD_MT_LDISKFS)); LASSERT(o->od_fsops); @@ -3688,8 +3691,10 @@ static struct lu_device *osd_device_fini(const struct lu_env *env, int rc; ENTRY; - shrink_dcache_sb(osd_sb(osd_dev(d))); - osd_sync(env, lu2dt_dev(d)); + if (osd_dev(d)->od_mnt) { + shrink_dcache_sb(osd_sb(osd_dev(d))); + osd_sync(env, lu2dt_dev(d)); + } rc = osd_procfs_fini(osd_dev(d)); if (rc) { -- 1.8.3.1