Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F105715982
D31712.id94333.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D31712.id94333.diff
View Options
Index: sys/kern/vfs_vnops.c
===================================================================
--- sys/kern/vfs_vnops.c
+++ sys/kern/vfs_vnops.c
@@ -3463,8 +3463,10 @@
static int
vn_deallocate_impl(struct vnode *vp, off_t *offset, off_t *length, int flags,
- int ioflag, struct ucred *active_cred, struct ucred *file_cred)
+ int ioflag, struct ucred *active_cred, struct ucred *file_cred,
+ bool from_fops)
{
+ struct ucred *cred;
struct mount *mp;
void *rl_cookie;
off_t off, len;
@@ -3508,9 +3510,14 @@
error = mac_vnode_check_write(active_cred, file_cred,
vp);
#endif
- if (error == 0)
+ if (error == 0) {
+ if (file_cred != NULL && !from_fops)
+ cred = file_cred;
+ else
+ cred = active_cred;
error = VOP_DEALLOCATE(vp, &off, &len, flags, ioflag,
- active_cred);
+ cred);
+ }
if ((ioflag & IO_NODELOCKED) == 0) {
VOP_UNLOCK(vp);
@@ -3541,7 +3548,7 @@
return (ENODEV);
return (vn_deallocate_impl(vp, offset, length, flags, ioflag,
- active_cred, file_cred));
+ active_cred, file_cred, false));
}
static int
@@ -3565,7 +3572,7 @@
switch (cmd) {
case SPACECTL_DEALLOC:
error = vn_deallocate_impl(vp, offset, length, flags, ioflag,
- active_cred, fp->f_cred);
+ active_cred, fp->f_cred, true);
break;
default:
panic("vn_fspacectl: unknown cmd %d", cmd);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 3:18 PM (20 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15531224
Default Alt Text
D31712.id94333.diff (1 KB)
Attached To
Mode
D31712: vfs: Use file_cred for VOP_DEALLOCATE in vn_deallocate if non-NULL
Attached
Detach File
Event Timeline
Log In to Comment