/* 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
}
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;
#include <libcfs/list.h>
#include <linux/lvfs.h>
#include <linux/lustre_fsfilt.h>
+#include <linux/lustre_disk.h>
#include "llog_internal.h"
#ifdef __KERNEL__
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;
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;
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);
}
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)
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);
/* 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);
} 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",