Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Nov 2017 10:02:53 -0700
From:      Mark Millard <markmi@dsl-only.net>
To:        Ed Maste <emaste@freebsd.org>
Cc:        Andriy Gapon <avg@freebsd.org>, FreeBSD Toolchain <freebsd-toolchain@freebsd.org>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: svn commit: r325320 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs [breaks lld on zfs: lld uses fallocate]
Message-ID:  <D475B3AF-6393-4405-9E5A-2233B920274B@dsl-only.net>
In-Reply-To: <CAPyFy2DYXvW%2BNo4kvaqGHFSPU7iH71suGCpvNgb3DPGScgUa_g@mail.gmail.com>
References:  <6140C4E2-168F-4E5D-B3C2-717ECB67C980@dsl-only.net> <134eea8e-1a2e-d77c-f7fa-01e14db7f47b@FreeBSD.org> <CAPyFy2DYXvW%2BNo4kvaqGHFSPU7iH71suGCpvNgb3DPGScgUa_g@mail.gmail.com>

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

On 2017-Nov-4, at 4:58 AM, Ed Maste <emaste at freebsd.org> wrote:

> On 4 November 2017 at 07:41, Andriy Gapon <avg at freebsd.org> wrote:
>> On 04/11/2017 12:32, Mark Millard wrote:
>>>  if (int Err =3D ::posix_fallocate(FD, 0, Size)) {
>>>    if (Err !=3D EOPNOTSUPP)
>>>      return std::error_code(Err, std::generic_category());
>>>  }
>>=20
>> The commit message that you didn't include into your reply contains =
some useful
>> information that authors / maintainers of this code should probably =
take into
>> account:
>>=20
>>>  Please note that EINVAL is used to report that the underlying file =
system
>>>  does not support the operation (POSIX.1-2008).
>>=20
>> Here is a link for that:
>> =
http://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.=
html
>=20
> I have no idea how they decided EINVAL was a reasonable errno for this =
case.
>=20
> Mark, can you give this patch a try:
>=20
> diff --git a/contrib/llvm/lib/Support/Unix/Path.inc
> b/contrib/llvm/lib/Support/Unix/Path.inc
> index 45097eb918b7..67edb46f0025 100644
> --- a/contrib/llvm/lib/Support/Unix/Path.inc
> +++ b/contrib/llvm/lib/Support/Unix/Path.inc
> @@ -427,7 +427,7 @@ std::error_code resize_file(int FD, uint64_t Size) =
{
>   // If we have posix_fallocate use it. Unlike ftruncate it always =
allocates
>   // space, so we get an error if the disk is full.
>   if (int Err =3D ::posix_fallocate(FD, 0, Size)) {
> -    if (Err !=3D EOPNOTSUPP)
> +    if (Err !=3D EINVAL && Err !=3D EOPNOTSUPP)
>       return std::error_code(Err, std::generic_category());

I've got a simple buildworld going but I expect that
it will end up using lld in a form that runs into
the problem. But I may luck out since I can link a
trivial main to produce an a.out for amd64.

It may be appropriate to have notes somewhere about
what to do for folks that land in the range -r325320
to whatever revision the updated
contrib/llvm/lib/Support/Unix/Path.inc ends up at
and that also have a zfs filesystem context involved.

I'll let you know if the build completes vs. not. It
takes a while since llvm materials are rebuilding.

=3D=3D=3D
Mark Millard
markmi at dsl-only.net




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D475B3AF-6393-4405-9E5A-2233B920274B>