]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - fs/affs/super.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-linus
[mirror_ubuntu-jammy-kernel.git] / fs / affs / super.c
index b53e5d0ec65c4b3fd52417dab5c85cdd176ebb76..d2dc047cb4796b4a879606e60349ec4eb55a79ae 100644 (file)
@@ -113,7 +113,6 @@ static void destroy_inodecache(void)
 static const struct super_operations affs_sops = {
        .alloc_inode    = affs_alloc_inode,
        .destroy_inode  = affs_destroy_inode,
-       .read_inode     = affs_read_inode,
        .write_inode    = affs_write_inode,
        .put_inode      = affs_put_inode,
        .drop_inode     = affs_drop_inode,
@@ -123,6 +122,7 @@ static const struct super_operations affs_sops = {
        .write_super    = affs_write_super,
        .statfs         = affs_statfs,
        .remount_fs     = affs_remount,
+       .show_options   = generic_show_options,
 };
 
 enum {
@@ -271,6 +271,9 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
        unsigned long            mount_flags;
        int                      tmp_flags;     /* fix remount prototype... */
        u8                       sig[4];
+       int                      ret = -EINVAL;
+
+       save_mount_options(sb, data);
 
        pr_debug("AFFS: read_super(%s)\n",data ? (const char *)data : "no options");
 
@@ -444,7 +447,12 @@ got_root:
 
        /* set up enough so that it can read an inode */
 
-       root_inode = iget(sb, root_block);
+       root_inode = affs_iget(sb, root_block);
+       if (IS_ERR(root_inode)) {
+               ret = PTR_ERR(root_inode);
+               goto out_error_noinode;
+       }
+
        sb->s_root = d_alloc_root(root_inode);
        if (!sb->s_root) {
                printk(KERN_ERR "AFFS: Get root inode failed\n");
@@ -461,12 +469,13 @@ got_root:
 out_error:
        if (root_inode)
                iput(root_inode);
+out_error_noinode:
        kfree(sbi->s_bitmap);
        affs_brelse(root_bh);
        kfree(sbi->s_prefix);
        kfree(sbi);
        sb->s_fs_info = NULL;
-       return -EINVAL;
+       return ret;
 }
 
 static int
@@ -481,14 +490,21 @@ affs_remount(struct super_block *sb, int *flags, char *data)
        int                      root_block;
        unsigned long            mount_flags;
        int                      res = 0;
+       char                    *new_opts = kstrdup(data, GFP_KERNEL);
 
        pr_debug("AFFS: remount(flags=0x%x,opts=\"%s\")\n",*flags,data);
 
        *flags |= MS_NODIRATIME;
 
-       if (!parse_options(data,&uid,&gid,&mode,&reserved,&root_block,
-           &blocksize,&sbi->s_prefix,sbi->s_volume,&mount_flags))
+       if (!parse_options(data, &uid, &gid, &mode, &reserved, &root_block,
+                          &blocksize, &sbi->s_prefix, sbi->s_volume,
+                          &mount_flags)) {
+               kfree(new_opts);
                return -EINVAL;
+       }
+       kfree(sb->s_options);
+       sb->s_options = new_opts;
+
        sbi->s_flags = mount_flags;
        sbi->s_mode  = mode;
        sbi->s_uid   = uid;