Whamcloud - gitweb
Handle bad or NULL data passed from mount to lustre.
authoradilger <adilger>
Tue, 24 Feb 2004 12:27:47 +0000 (12:27 +0000)
committeradilger <adilger>
Tue, 24 Feb 2004 12:27:47 +0000 (12:27 +0000)
b=2529

lustre/llite/llite_lib.c

index 36b0250..ceaa4e0 100644 (file)
@@ -385,6 +385,9 @@ int lustre_process_log(struct lustre_mount_data *lmd, char * profile,
         int err;
         ENTRY;
 
+        if (lmd_bad_magic(lmd))
+                RETURN(-EINVAL);
+
         generate_random_uuid(uuid);
         class_uuid_unparse(uuid, &mdc_uuid);
 
@@ -510,10 +513,9 @@ int lustre_fill_super(struct super_block *sb, void *data, int silent)
         ENTRY;
 
         CDEBUG(D_VFSTRACE, "VFS Op: sb %p\n", sb);
-        if (lmd == NULL) {
-                CERROR("lustre_mount_data is NULL: check that /sbin/mount.lustre exists?\n");
+        if (lmd_bad_magic(lmd))
                 RETURN(-EINVAL);
-        }
+
         sbi = lustre_init_sbi(sb);
         if (!sbi)
                 RETURN(-ENOMEM);