spufs: fix a crash in spufs_create_root()
authorEmmanuel Nicolet <emmanuel.nicolet@gmail.com>
Tue, 8 Oct 2019 14:13:42 +0000 (16:13 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 11 Oct 2019 05:57:41 +0000 (16:57 +1100)
The spu_fs_context was not set in fc->fs_private, this caused a crash
when accessing ctx->mode in spufs_create_root().

Fixes: d2e0981c3b9a ("vfs: Convert spufs to use the new mount API")
Signed-off-by: Emmanuel Nicolet <emmanuel.nicolet@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20191008141342.GA266797@gmail.com
arch/powerpc/platforms/cell/spufs/inode.c

index 1d93e55a2de1e2da86fbaa4335665d54c766a02f..2dd452a047cd6c9fa68fa80d45587e3392e60db2 100644 (file)
@@ -761,6 +761,7 @@ static int spufs_init_fs_context(struct fs_context *fc)
        ctx->gid = current_gid();
        ctx->mode = 0755;
 
+       fc->fs_private = ctx;
        fc->s_fs_info = sbi;
        fc->ops = &spufs_context_ops;
        return 0;