Revert "ANDROID: mnt: Fix null pointer dereference"

This reverts commit cbfbd9e932
(change I6aedaa89536ae85e6bc29093f38934c672c8fe42).

This is no longer needed because the only user of vfsmount::data was
sdcardfs, and sdcardfs has now been removed.

Bug: 157700134
Change-Id: I1f4da1a9e6ce1c3509fdf233cf9de446a53b28da
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Eric Biggers 2020-08-07 10:00:27 -07:00 committed by Greg Kroah-Hartman
parent 3663c286ac
commit 87b919b2a2

View File

@ -951,11 +951,9 @@ static struct mount *skip_mnt_tree(struct mount *p)
struct vfsmount *vfs_create_mount(struct fs_context *fc)
{
struct mount *mnt;
struct super_block *sb;
if (!fc->root)
return ERR_PTR(-EINVAL);
sb = fc->root->d_sb;
mnt = alloc_vfsmnt(fc->source ?: "none");
if (!mnt)
@ -968,8 +966,7 @@ struct vfsmount *vfs_create_mount(struct fs_context *fc)
free_vfsmnt(mnt);
return ERR_PTR(-ENOMEM);
}
if (sb->s_op->update_mnt_data)
sb->s_op->update_mnt_data(mnt->mnt.data, fc);
fc->root->d_sb->s_op->update_mnt_data(mnt->mnt.data, fc);
}
if (fc->sb_flags & SB_KERNMOUNT)
mnt->mnt.mnt_flags = MNT_INTERNAL;
@ -2632,7 +2629,7 @@ static int do_remount(struct path *path, int ms_flags, int sb_flags,
err = -EPERM;
if (ns_capable(sb->s_user_ns, CAP_SYS_ADMIN)) {
err = reconfigure_super(fc);
if (!err && sb->s_op->update_mnt_data) {
if (!err) {
sb->s_op->update_mnt_data(mnt->mnt.data, fc);
set_mount_attributes(mnt, mnt_flags);
namespace_lock();
@ -2640,8 +2637,7 @@ static int do_remount(struct path *path, int ms_flags, int sb_flags,
propagate_remount(mnt);
unlock_mount_hash();
namespace_unlock();
} else if (!err)
set_mount_attributes(mnt, mnt_flags);
}
}
up_write(&sb->s_umount);
}