Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/cddl/osnet/dist/uts/common/fs/zfs Add fstrans_start...
details: https://anonhg.NetBSD.org/src/rev/29742bb34e6e
branches: trunk
changeset: 457228:29742bb34e6e
user: hannken <hannken%NetBSD.org@localhost>
date: Mon Jun 17 08:08:21 2019 +0000
description:
Add fstrans_start()/fstrans_done() and bounds check to zfs_netbsd_getpages().
diffstat:
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diffs (42 lines):
diff -r c88bb8530c9d -r 29742bb34e6e external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c
--- a/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c Mon Jun 17 08:07:56 2019 +0000
+++ b/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c Mon Jun 17 08:08:21 2019 +0000
@@ -5892,6 +5892,7 @@
kmutex_t * const mtx = uobj->vmobjlock;
znode_t *zp = VTOZ(vp);
zfsvfs_t *zfsvfs = zp->z_zfsvfs;
+ vfs_t *mp;
struct vm_page *pg;
caddr_t va;
int npages, found, err = 0;
@@ -5910,10 +5911,22 @@
return EBUSY;
}
+ mp = vp->v_mount;
+ fstrans_start(mp);
+ if (vp->v_mount != mp) {
+ fstrans_done(mp);
+ return ENOENT;
+ }
ZFS_ENTER(zfsvfs);
ZFS_VERIFY_ZP(zp);
mutex_enter(mtx);
+ if (offset >= vp->v_size) {
+ mutex_exit(mtx);
+ ZFS_EXIT(zfsvfs);
+ fstrans_done(mp);
+ return EINVAL;
+ }
npages = 1;
pg = NULL;
uvn_findpages(uobj, offset, &npages, &pg, UFP_ALL);
@@ -5943,6 +5956,7 @@
ap->a_m[ap->a_centeridx] = pg;
ZFS_EXIT(zfsvfs);
+ fstrans_done(mp);
return (err);
}
Home |
Main Index |
Thread Index |
Old Index