From ed587060e225a85aa5eff3ba583a8b6508eaab7b Mon Sep 17 00:00:00 2001 From: johann Date: Wed, 6 Aug 2008 08:42:05 +0000 Subject: [PATCH] Branch HEAD b=16140 i=nathan i=bobijam pass journal_dev mount option during pre-mount. --- lustre/ChangeLog | 8 +++++++- lustre/obdclass/obd_mount.c | 26 ++++++++++++++++++-------- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 8d9fd29..7b8ecd5 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -22,7 +22,7 @@ Severity : normal Bugzilla : 15576 Description: Resolve device initialization race Details : Prevent proc handler from accessing devices added to the - obd_devs array but yet be intialized. + obd_devs array but yet be intialized. Severity : enhancement Bugzilla : 15308 @@ -1263,6 +1263,12 @@ Description: Kernel panics during QLogic driver reload Details : REQ_BLOCK_PC requests are not handled properly in the sd iostat patch, causing memory corruption. +Severity : minor +Frequency : rare +Bugzilla : 16140 +Description: journal_dev option does not work in b1_6 +Details : pass mount option during pre-mount. + -------------------------------------------------------------------------------- 2007-08-10 Cluster File Systems, Inc. diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index af04942..33f1ebd 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -1269,9 +1269,23 @@ static struct vfsmount *server_kernel_mount(struct super_block *sb) Note ext3/ldiskfs can't be mounted ro. */ s_flags = sb->s_flags; + /* allocate memory for options */ + OBD_PAGE_ALLOC(__page, CFS_ALLOC_STD); + if (!__page) + GOTO(out_free, rc = -ENOMEM); + page = (unsigned long)cfs_page_address(__page); + options = (char *)page; + memset(options, 0, CFS_PAGE_SIZE); + + /* mount-line options must be added for pre-mount because it may + * contain mount options such as journal_dev which are required + * to mount successfuly the underlying filesystem */ + if (lmd->lmd_opts && (*(lmd->lmd_opts) != 0)) + strncat(options, lmd->lmd_opts, CFS_PAGE_SIZE - 1); + /* Pre-mount ldiskfs to read the MOUNT_DATA_FILE */ CDEBUG(D_MOUNT, "Pre-mount ldiskfs %s\n", lmd->lmd_dev); - mnt = ll_kern_mount("ldiskfs", s_flags, lmd->lmd_dev, 0); + mnt = ll_kern_mount("ldiskfs", s_flags, lmd->lmd_dev, (void *)options); if (IS_ERR(mnt)) { rc = PTR_ERR(mnt); CERROR("premount %s:%#lx ldiskfs failed: %d " @@ -1296,12 +1310,6 @@ static struct vfsmount *server_kernel_mount(struct super_block *sb) /* Done with our pre-mount, now do the real mount. */ /* Glom up mount options */ - OBD_PAGE_ALLOC(__page, CFS_ALLOC_STD); - if (!__page) - GOTO(out_free, rc = -ENOMEM); - page = (unsigned long)cfs_page_address(__page); - - options = (char *)page; memset(options, 0, CFS_PAGE_SIZE); strncpy(options, ldd->ldd_mount_opts, CFS_PAGE_SIZE - 2); @@ -1321,18 +1329,20 @@ static struct vfsmount *server_kernel_mount(struct super_block *sb) MT_STR(ldd), lmd->lmd_dev, options); mnt = ll_kern_mount(MT_STR(ldd), s_flags, lmd->lmd_dev, (void *)options); - OBD_PAGE_FREE(__page); if (IS_ERR(mnt)) { rc = PTR_ERR(mnt); CERROR("ll_kern_mount failed: rc = %d\n", rc); GOTO(out_free, rc); } + OBD_PAGE_FREE(__page); lsi->lsi_ldd = ldd; /* freed at lsi cleanup */ CDEBUG(D_SUPER, "%s: mnt = %p\n", lmd->lmd_dev, mnt); RETURN(mnt); out_free: + if (__page) + OBD_PAGE_FREE(__page); OBD_FREE(ldd, sizeof(*ldd)); lsi->lsi_ldd = NULL; RETURN(ERR_PTR(rc)); -- 1.8.3.1