- Protect mnt_data and mnt_flags under the mount interlock
- Move mp->mnt_stat manipulation where all of them happens Reported by: davide Discussed with: kib Tested by: flo MFC after: 2 months X-MFC: 241519, 242536,242616, 242727
This commit is contained in:
parent
0c704c35ef
commit
1750b7b9c8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=242875
@ -234,8 +234,10 @@ fuse_vfsop_mount(struct mount *mp)
|
|||||||
if (mp->mnt_flag & MNT_UPDATE)
|
if (mp->mnt_flag & MNT_UPDATE)
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
|
|
||||||
|
MNT_ILOCK(mp);
|
||||||
mp->mnt_flag |= MNT_SYNCHRONOUS;
|
mp->mnt_flag |= MNT_SYNCHRONOUS;
|
||||||
mp->mnt_data = NULL;
|
mp->mnt_data = NULL;
|
||||||
|
MNT_IUNLOCK(mp);
|
||||||
/* Get the new options passed to mount */
|
/* Get the new options passed to mount */
|
||||||
opts = mp->mnt_optnew;
|
opts = mp->mnt_optnew;
|
||||||
|
|
||||||
@ -323,22 +325,20 @@ fuse_vfsop_mount(struct mount *mp)
|
|||||||
FUSE_UNLOCK();
|
FUSE_UNLOCK();
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
/* We need this here as this slot is used by getnewvnode() */
|
|
||||||
mp->mnt_stat.f_iosize = PAGE_SIZE;
|
|
||||||
mp->mnt_data = data;
|
|
||||||
data->ref++;
|
data->ref++;
|
||||||
data->mp = mp;
|
data->mp = mp;
|
||||||
data->dataflags |= mntopts;
|
data->dataflags |= mntopts;
|
||||||
data->max_read = max_read;
|
data->max_read = max_read;
|
||||||
data->daemon_timeout = daemon_timeout;
|
data->daemon_timeout = daemon_timeout;
|
||||||
#ifdef XXXIP
|
|
||||||
if (!priv_check(td, PRIV_VFS_FUSE_SYNC_UNMOUNT))
|
|
||||||
data->dataflags |= FSESS_CAN_SYNC_UNMOUNT;
|
|
||||||
#endif
|
|
||||||
FUSE_UNLOCK();
|
FUSE_UNLOCK();
|
||||||
|
|
||||||
vfs_getnewfsid(mp);
|
vfs_getnewfsid(mp);
|
||||||
|
MNT_ILOCK(mp);
|
||||||
|
mp->mnt_data = data;
|
||||||
mp->mnt_flag |= MNT_LOCAL;
|
mp->mnt_flag |= MNT_LOCAL;
|
||||||
|
MNT_IUNLOCK(mp);
|
||||||
|
/* We need this here as this slot is used by getnewvnode() */
|
||||||
|
mp->mnt_stat.f_iosize = PAGE_SIZE;
|
||||||
if (subtype) {
|
if (subtype) {
|
||||||
strlcat(mp->mnt_stat.f_fstypename, ".", MFSNAMELEN);
|
strlcat(mp->mnt_stat.f_fstypename, ".", MFSNAMELEN);
|
||||||
strlcat(mp->mnt_stat.f_fstypename, subtype, MFSNAMELEN);
|
strlcat(mp->mnt_stat.f_fstypename, subtype, MFSNAMELEN);
|
||||||
|
Loading…
Reference in New Issue
Block a user