From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 11 03:48:55 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 288CB106564A for ; Sun, 11 Jan 2009 03:48:55 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from kientzle.com (kientzle.com [66.166.149.50]) by mx1.freebsd.org (Postfix) with ESMTP id 00E098FC16 for ; Sun, 11 Jan 2009 03:48:54 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from [10.123.2.23] (h-66-166-149-52.snvacaid.covad.net [66.166.149.52]) by kientzle.com (8.12.9/8.12.9) with ESMTP id n0B3msC1001968; Sat, 10 Jan 2009 19:48:54 -0800 (PST) (envelope-from kientzle@freebsd.org) Message-ID: <49696C24.8010601@freebsd.org> Date: Sat, 10 Jan 2009 19:48:52 -0800 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20060422 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pluknet References: <49692659.2030306@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: extattr problems? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 03:48:55 -0000 pluknet wrote: > 2009/1/11 Tim Kientzle : > >>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. Oh, but that gives me an idea ... ... 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. Time to dig through kernel sources.... Tim