Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Aug 2019 19:38:58 -0700
From:      Conrad Meyer <cem@freebsd.org>
To:        Rick Macklem <rmacklem@freebsd.org>
Cc:        src-committers <src-committers@freebsd.org>, svn-src-all <svn-src-all@freebsd.org>,  svn-src-head <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r350315 - in head/sys: kern sys
Message-ID:  <CAG6CVpU-35F11-FNzM2ZVoCU6WXgN2VLoG7aDo8O-v6j3FAdkQ@mail.gmail.com>
In-Reply-To: <201907250546.x6P5kHWq076756@repo.freebsd.org>
References:  <201907250546.x6P5kHWq076756@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Rick,

Coverity reports that the following portion of
vn_generic_copy_file_range() is deadcode (CID 1403974), and it is:

On Wed, Jul 24, 2019 at 10:46 PM Rick Macklem <rmacklem@freebsd.org> wrote:
>
> Author: rmacklem
> Date: Thu Jul 25 05:46:16 2019
> New Revision: 350315
> URL: https://svnweb.freebsd.org/changeset/base/350315
>
> Log:
>   Add kernel support for a Linux compatible copy_file_range(2) syscall.
> ...
> Modified: head/sys/kern/vfs_vnops.c
> ==============================================================================
> --- head/sys/kern/vfs_vnops.c   Thu Jul 25 03:55:05 2019        (r350314)
> +++ head/sys/kern/vfs_vnops.c   Thu Jul 25 05:46:16 2019        (r350315)
> ...
> +int
> +vn_generic_copy_file_range(struct vnode *invp, off_t *inoffp,
> +    struct vnode *outvp, off_t *outoffp, size_t *lenp, unsigned int flags,
> +    struct ucred *incred, struct ucred *outcred, struct thread *fsize_td)
> +{
> ...
> +       error = vn_lock(invp, LK_SHARED);
> +       if (error != 0)
> +               goto out;

// error is now zero

> +       if (VOP_PATHCONF(invp, _PC_MIN_HOLE_SIZE, &holein) != 0)
> +               holein = 0;
> +       VOP_UNLOCK(invp, 0);

// the following condition is impossible:

> +       if (error != 0)
> +               goto out;

Best,
Conrad



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG6CVpU-35F11-FNzM2ZVoCU6WXgN2VLoG7aDo8O-v6j3FAdkQ>