Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Jan 2009 11:04:45 +0300
From:      pluknet <pluknet@gmail.com>
To:        "Tim Kientzle" <kientzle@freebsd.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: extattr problems?
Message-ID:  <a31046fc0901110004m629f9aeegc4ac1cdfd1591c69@mail.gmail.com>
In-Reply-To: <49696C24.8010601@freebsd.org>
References:  <49692659.2030306@freebsd.org> <a31046fc0901101836q1f43028awe4f7b0ba746248ac@mail.gmail.com> <49696C24.8010601@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
2009/1/11 Tim Kientzle <kientzle@freebsd.org>:
> pluknet wrote:
>>
>> 2009/1/11 Tim Kientzle <kientzle@freebsd.org>:
>>
>>> FreeBSD 6.3:
>>>
>>> fd = open("test", O_WRONLY | O_CREAT | O_EXCL, 0777);
>>> n = extattr_set_fd(fd, EXTATTR_NAMESPACE_USER, "testattr", "1234", 4);
>>>
>>> After this, fd=3, n is non-zero, errno = 9 (EBADF)
>>>
>>> Huh?  I would have expected EOPNOTSUPP if
>>> extended attributes weren't supported on this
>>> filesystem.  The file descriptor is clearly
>>> valid.
>>
>> Simple guess.
>> Don't hit me if I'm wrong. :)
>>
>> You call open() with (O_CREAT | O_EXCL) on an already existing file.
>
> Nope.  As you can see from my earlier summary,
> fd=3 immediately after this, so the open did
> succeed normally.

Ah, I'm sorry. My inadvertency.

>
> Oh, but that gives me an idea ... <checking, checking>
> ... darn.  Still no joy.  I tried changing the open to
> open("test", O_RDWR | O_CREATE, 0777) and it still
> fails in exactly the same way.  The open still succeeds
> and the extattr_set_fd() still fails with a nonsensical
> errno value.

It's strange..
FreeBSD jaw.ripn.net 6.3-RELEASE-p5.
works for me (tm), extattr_set_fd() returns 4 as expected.

Also works on 7.1 at home.

>
> Time to dig through kernel sources....
>
> Tim
>

-- 
wbr,
pluknet



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a31046fc0901110004m629f9aeegc4ac1cdfd1591c69>