From owner-svn-src-stable@freebsd.org Sat Mar 31 12:44:12 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 844C2F527FB; Sat, 31 Mar 2018 12:44:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A61A81D7C; Sat, 31 Mar 2018 12:44:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B02817FCC; Sat, 31 Mar 2018 12:44:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2VCiBp7051563; Sat, 31 Mar 2018 12:44:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2VCiBW6051562; Sat, 31 Mar 2018 12:44:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201803311244.w2VCiBW6051562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 31 Mar 2018 12:44:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331840 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 331840 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Mar 2018 12:44:12 -0000 Author: kib Date: Sat Mar 31 12:44:11 2018 New Revision: 331840 URL: https://svnweb.freebsd.org/changeset/base/331840 Log: MFC r331487: In vn_io_fault1(), reduce the scope where pagefaults are disabled. Modified: stable/11/sys/kern/vfs_vnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_vnops.c ============================================================================== --- stable/11/sys/kern/vfs_vnops.c Sat Mar 31 12:43:07 2018 (r331839) +++ stable/11/sys/kern/vfs_vnops.c Sat Mar 31 12:44:11 2018 (r331840) @@ -954,23 +954,30 @@ static int vn_io_fault_doio(struct vn_io_fault_args *args, struct uio *uio, struct thread *td) { + int error, save; + error = 0; + save = vm_fault_disable_pagefaults(); switch (args->kind) { case VN_IO_FAULT_FOP: - return ((args->args.fop_args.doio)(args->args.fop_args.fp, - uio, args->cred, args->flags, td)); + error = (args->args.fop_args.doio)(args->args.fop_args.fp, + uio, args->cred, args->flags, td); + break; case VN_IO_FAULT_VOP: if (uio->uio_rw == UIO_READ) { - return (VOP_READ(args->args.vop_args.vp, uio, - args->flags, args->cred)); + error = VOP_READ(args->args.vop_args.vp, uio, + args->flags, args->cred); } else if (uio->uio_rw == UIO_WRITE) { - return (VOP_WRITE(args->args.vop_args.vp, uio, - args->flags, args->cred)); + error = VOP_WRITE(args->args.vop_args.vp, uio, + args->flags, args->cred); } break; + default: + panic("vn_io_fault_doio: unknown kind of io %d %d", + args->kind, uio->uio_rw); } - panic("vn_io_fault_doio: unknown kind of io %d %d", args->kind, - uio->uio_rw); + vm_fault_enable_pagefaults(save); + return (error); } static int @@ -1045,7 +1052,7 @@ vn_io_fault1(struct vnode *vp, struct uio *uio, struct vm_offset_t addr, end; size_t len, resid; ssize_t adv; - int error, cnt, save, saveheld, prev_td_ma_cnt; + int error, cnt, saveheld, prev_td_ma_cnt; if (vn_io_fault_prefault) { error = vn_io_fault_prefault_user(uio); @@ -1071,7 +1078,6 @@ vn_io_fault1(struct vnode *vp, struct uio *uio, struct short_uio.uio_rw = uio->uio_rw; short_uio.uio_td = uio->uio_td; - save = vm_fault_disable_pagefaults(); error = vn_io_fault_doio(args, uio, td); if (error != EFAULT) goto out; @@ -1142,7 +1148,6 @@ vn_io_fault1(struct vnode *vp, struct uio *uio, struct td->td_ma_cnt = prev_td_ma_cnt; curthread_pflags_restore(saveheld); out: - vm_fault_enable_pagefaults(save); free(uio_clone, M_IOV); return (error); }