svn commit: r349391 - head/sys/kern

Conrad Meyer cem at freebsd.org
Sun Jul 14 19:35:12 UTC 2019


Hi Alan,

This change restores the possible overflow beyond IO_SEQMAX that the
removed conditional prevented.

On Tue, Jun 25, 2019 at 12:44 PM Alan Somers <asomers at freebsd.org> wrote:
>
> Author: asomers
> Date: Tue Jun 25 19:44:22 2019
> New Revision: 349391
> URL: https://svnweb.freebsd.org/changeset/base/349391
>
> --- head/sys/kern/vfs_vnops.c   Tue Jun 25 19:36:01 2019        (r349390)
> +++ head/sys/kern/vfs_vnops.c   Tue Jun 25 19:44:22 2019        (r349391)
> @@ -499,10 +499,8 @@ sequential_heuristic(struct uio *uio, struct file *fp)
>                  * closely related to the best I/O size for real disks than
>                  * to any block size used by software.
>                  */
> -               fp->f_seqcount += MIN(IO_SEQMAX,
> +               fp->f_seqcount += lmin(IO_SEQMAX,
>                     howmany(uio->uio_resid, 16384));
> -               if (fp->f_seqcount > IO_SEQMAX)
> -                       fp->f_seqcount = IO_SEQMAX;
>                 return (fp->f_seqcount << IO_SEQSHIFT);
>         }

Perhaps instead this should be:

fp->f_seqcount = lmin(IO_SEQMAX,
  fp->f_seqcount + howmany(...));

Best,
Conrad


More information about the svn-src-head mailing list