fusefs: don't allow truncating irregular files on an read-only mount

The readonly mount check had a special case allowing the sizes of files to
be changed if they weren't regular files.  I don't know why.  Neither UFS,
ZFS, nor ext2 have such a special case, and I don't know when you would ever
change the size of a non-regular file anyway.

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Alan Somers 2019-05-06 15:20:18 +00:00
parent e5ff3a7e28
commit ac0a68e9cd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/fuse2/; revision=347184

View File

@ -1625,7 +1625,7 @@ fuse_vnop_setattr(struct vop_setattr_args *ap)
err = EISDIR;
goto out;
}
if (vfs_isrdonly(vnode_mount(vp)) && (fsai->valid & ~FATTR_SIZE || vtyp == VREG)) {
if (vfs_isrdonly(vnode_mount(vp))) {
err = EROFS;
goto out;
}