From: nathan Date: Tue, 9 Aug 2005 00:07:48 +0000 (+0000) Subject: Branch b1_4_newconfig2 X-Git-Tag: v1_8_0_110~486^4~175^2~16 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=90cce3957f1425c2efffdd531380a6e16508d86f;p=fs%2Flustre-release.git Branch b1_4_newconfig2 b=6663 mkfs.lustre now creates startup logs through mds, soon to be mcobd --- diff --git a/lustre/include/linux/lustre_disk.h b/lustre/include/linux/lustre_disk.h index 8aee9f3..574ecb8 100644 --- a/lustre/include/linux/lustre_disk.h +++ b/lustre/include/linux/lustre_disk.h @@ -35,8 +35,8 @@ /* Persistent mount data are stored on the disk in this file. Used before the setup llog can be read. */ -#define MOUNT_CONFIGS_DIR "CONFIGS/" -#define MOUNT_DATA_FILE MOUNT_CONFIGS_DIR"mountdata" +#define MOUNT_CONFIGS_DIR "CONFIGS" +#define MOUNT_DATA_FILE MOUNT_CONFIGS_DIR"/mountdata" #define LDD_MAGIC 0xbabb0001 diff --git a/lustre/mds/mds_fs.c b/lustre/mds/mds_fs.c index 48e10c9..cd9b135 100644 --- a/lustre/mds/mds_fs.c +++ b/lustre/mds/mds_fs.c @@ -468,10 +468,11 @@ int mds_fs_setup(struct obd_device *obd, struct vfsmount *mnt) } mds->mds_pending_dir = dentry; - dentry = simple_mkdir(current->fs->pwd, "LOGS", 0777, 1); + dentry = simple_mkdir(current->fs->pwd, MOUNT_CONFIGS_DIR, 0777, 1); if (IS_ERR(dentry)) { rc = PTR_ERR(dentry); - CERROR("cannot create LOGS directory: rc = %d\n", rc); + CERROR("cannot create %s directory: rc = %d\n", + MOUNT_CONFIGS_DIR, rc); GOTO(err_pending, rc); } mds->mds_logs_dir = dentry; diff --git a/lustre/obdclass/llog_lvfs.c b/lustre/obdclass/llog_lvfs.c index b466ef3..bb66155 100644 --- a/lustre/obdclass/llog_lvfs.c +++ b/lustre/obdclass/llog_lvfs.c @@ -45,6 +45,7 @@ #include #include #include +#include #include "llog_internal.h" #ifdef __KERNEL__ @@ -573,7 +574,8 @@ static int llog_lvfs_destroy(struct llog_handle *handle) ENTRY; fdentry = handle->lgh_file->f_dentry; - if (!strcmp(fdentry->d_parent->d_name.name, "LOGS")) { + if (strcmp(fdentry->d_parent->d_name.name, MOUNT_CONFIGS_DIR) == 0) { + /* CONFIGS files aren't really "lustre" objects - special case*/ struct obd_device *obd = handle->lgh_ctxt->loc_exp->exp_obd; struct inode *inode = fdentry->d_parent->d_inode; struct lvfs_run_ctxt saved; diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index d9945ea..96dd8da 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -415,7 +415,7 @@ static void server_put_super(struct super_block *sb) err = dentry_readdir(obd, mgcobd->mgc_configs_dir, mgcobd->mgc_vfsmnt, &dentry_list); if (err) - CERROR("Can't read LOGS dir, %d\n", err); + CERROR("Can't read %s dir, %d\n", MOUNT_CONFIGS_DIR, err); list_for_each_entry_safe(dirent, n, &dentry_list, lld_list) { char *logname; @@ -650,7 +650,7 @@ int lustre_process_logs(struct super_block *sb, err = dentry_readdir(obd, mgcobd->mgc_configs_dir, mgcobd->mgc_vfsmnt, &dentry_list); if (err) { - CERROR("Can't read LOGS dir\n"); + CERROR("Can't read %s dir, rc=%d\n", MOUNT_CONFIGS_DIR, err); return(err); } diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 6cb127b..7391be8 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -369,7 +369,7 @@ static int filter_init_server_data(struct obd_device *obd, struct file * filp) LASSERT (offsetof(struct filter_client_data, fcd_padding) + sizeof(fcd->fcd_padding) == FILTER_LR_CLIENT_SIZE); LASSERT(FILTER_LR_CLIENT_SIZE == LR_CLIENT_SIZE); - LASSERT(FILTER_LR_CLIENT_START == LR_CLIENT_SIZE); + LASSERT(FILTER_LR_CLIENT_START == LR_CLIENT_START); OBD_ALLOC(fsd, sizeof(*fsd)); if (!fsd) diff --git a/lustre/utils/mkfs_lustre.c b/lustre/utils/mkfs_lustre.c index 95e118c3..5e75eda 100644 --- a/lustre/utils/mkfs_lustre.c +++ b/lustre/utils/mkfs_lustre.c @@ -308,6 +308,7 @@ int write_local_files(struct mkfs_opts *mop) if (mop->mo_flags & MO_IS_LOOP) { /* ext3 can't understand iopen_nopriv, others */ + // FIXME ext3 on 2.6 can't. So use ldiskfs on 2.6 if (strlen(mop->mo_ldd.ldd_mount_opts)) snprintf(local_mount_opts, sizeof(local_mount_opts), "loop,%s", mop->mo_ldd.ldd_mount_opts); @@ -326,7 +327,7 @@ int write_local_files(struct mkfs_opts *mop) /* Set up initial directories */ sprintf(filepnm, "%s/%s", mntpt, MOUNT_CONFIGS_DIR); - ret = mkdir(filepnm, 0755); + ret = mkdir(filepnm, 0777); if (ret) { fprintf(stderr, "Can't make configs dir %s (%d)\n", filepnm, ret); @@ -1083,6 +1084,7 @@ int main(int argc , char *const argv[]) } else if (mop.mo_ldd.ldd_mount_type == LDD_MT_LDISKFS) { sprintf(mop.mo_ldd.ldd_mount_opts, "errors=remount-ro"); if (IS_MDT(&mop.mo_ldd)) + // FIXME ext3 also strcat(mop.mo_ldd.ldd_mount_opts, ",iopen_nopriv"); } else if (mop.mo_ldd.ldd_mount_type == LDD_MT_SMFS) { sprintf(mop.mo_ldd.ldd_mount_opts, "type=ext3,dev=%s",