From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 11 08:04:46 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 DD15E1065670; Sun, 11 Jan 2009 08:04:46 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.153]) by mx1.freebsd.org (Postfix) with ESMTP id 408EB8FC25; Sun, 11 Jan 2009 08:04:46 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so3442728fgb.35 for ; Sun, 11 Jan 2009 00:04:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=kEP+OVGUjrba3M6xBCo4OrLrlkOaZ7kZr2R+ibkkhuc=; b=GjIOgCT+ZE41bfFZnvHH5/mLhCmfktq9Sv/mC5H+3I06jagcDuiZTxLTpF4k4vnukH 1DNbPucN/mnQVm4VcgFiMj/ssEEobw57kftCK6dUtur2Ybo7T4A/TvUTUBEwDCrRd/BS cW+nag+xLxCAFr/Si0m24Rja+idfAaZFkVXyE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=op3v7WLYqA9Ty/hSw5XAu0uvZn/yzf/tinBcyVD9kr0/vYfPQh/IkjRyHtRz3tcmoQ lTRKp8jpncIKUH6gjNmqf9YQUPm+VxT5u9Vg0tVjYXbGs0zShCr/5MVuXIisqcwCnfPf h7ScSycNqW6AeR/CuFhWg+uFirt/ScDlpgB6s= Received: by 10.86.82.6 with SMTP id f6mr10441629fgb.42.1231661085167; Sun, 11 Jan 2009 00:04:45 -0800 (PST) Received: by 10.86.72.19 with HTTP; Sun, 11 Jan 2009 00:04:45 -0800 (PST) Message-ID: Date: Sun, 11 Jan 2009 11:04:45 +0300 From: pluknet To: "Tim Kientzle" In-Reply-To: <49696C24.8010601@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <49692659.2030306@freebsd.org> <49696C24.8010601@freebsd.org> 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 08:04:47 -0000 2009/1/11 Tim Kientzle : > 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. Ah, I'm sorry. My inadvertency. > > 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. 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