From owner-freebsd-current@FreeBSD.ORG Fri Jun 5 13:55:09 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1174106567B; Fri, 5 Jun 2009 13:55:09 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 6F3C78FC19; Fri, 5 Jun 2009 13:55:09 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 0787946B29; Fri, 5 Jun 2009 09:55:09 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id CC6178A040; Fri, 5 Jun 2009 09:55:07 -0400 (EDT) From: John Baldwin To: freebsd-current@freebsd.org Date: Fri, 5 Jun 2009 09:45:51 -0400 User-Agent: KMail/1.9.7 References: <20090604010719.GC15659@hades.panopticon> <4A2750F0.3070106@freebsd.org> <20090604135402.GT1927@deviant.kiev.zoral.com.ua> In-Reply-To: <20090604135402.GT1927@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906050945.52511.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 05 Jun 2009 09:55:07 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Kostik Belousov , Tim Kientzle , Dmitry Marakasov Subject: Re: Missing extattr syscalls on compat32 (was Re: libarchive extattr i386/amd64 syscall issue) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 13:55:10 -0000 On Thursday 04 June 2009 9:54:02 am Kostik Belousov wrote: > On Wed, Jun 03, 2009 at 09:43:28PM -0700, Tim Kientzle wrote: > > Dmitry Marakasov wrote: > > > > > >The problem: on recent current, 32bit bsdtar won't write archives when > > >running under 64bit kernel, dying with exit code 140 and `Bad system call' > > >message. I've ran into that using i386 tinderbox jail on amd64 host. > > >The problem actually happens in libarchive: > > > > > >--- lib/libarchive/archive_read_disk_entry_from_file.c --- > > > 484 if (!a->follow_symlinks) > > > 485 list_size = extattr_list_link(path, > > > namespace, NULL, 0); // <-- HERE > > > 486 else > > > 487 list_size = extattr_list_file(path, > > > namespace, NULL, 0); > > >--- lib/libarchive/archive_read_disk_entry_from_file.c --- > > > > Yes, it looks like only about half of the extattr calls are > > actually connected in the freebsd32 compatibility layer. (see below) > > According to SVN history, peter@ reserved these slots back > > in December 2003 but no one ever went back and connected > > them up. I don't know if there was a reason for not > > connecting them or if simply no one remembered to do so. > > I would guess the latter; the ones that are connected > > were all implemented before mid-2002. > > > > I don't see any obvious reason these should not just > > work. If you're feeling adventurous, you could try > > copying the data from /usr/src/kern/syscalls.master > > and see what happens. I don't have a 64-bit system > > handy here or I would try this myself. > > > > You can test by going to /usr/src/lib/libarchive/test and > > running "make check". That will build and run the libarchive > > test suite, which does exercise the extended attribute support. > > (Of course, you should revert your change first so that the > > extended attribute support is actually compiled.) > > > > Let me know if you find anything, > > > > Tim > > > > > > $ grep extattr /usr/src/sys/compat/freebsd32/syscalls.master > > 355 AUE_EXTATTRCTL NOPROTO { int extattrctl(const char *path, int > > cmd, \ > > 356 AUE_EXTATTR_SET_FILE NOPROTO { int extattr_set_file( \ > > 357 AUE_EXTATTR_GET_FILE NOPROTO { ssize_t extattr_get_file( \ > > 358 AUE_EXTATTR_DELETE_FILE NOPROTO { int extattr_delete_file( \ > > 371 AUE_EXTATTR_SET_FD NOPROTO { int extattr_set_fd(int fd, \ > > 372 AUE_EXTATTR_GET_FD NOPROTO { ssize_t extattr_get_fd(int fd, \ > > 373 AUE_EXTATTR_DELETE_FD NOPROTO { int extattr_delete_fd(int fd, \ > > 412 AUE_EXTATTR_SET_LINK UNIMPL extattr_set_link > > 413 AUE_EXTATTR_GET_LINK UNIMPL extattr_get_link > > 414 AUE_EXTATTR_DELETE_LINK UNIMPL extattr_delete_link > > 437 AUE_EXTATTR_LIST_FD UNIMPL extattr_list_fd > > 438 AUE_EXTATTR_LIST_FILE UNIMPL extattr_list_file > > 439 AUE_EXTATTR_LIST_LINK UNIMPL extattr_list_link > > The size_t arguments need translation. Please try the patch below. Err, size_t is 32-bit for freebsd32. Only 64-bit types like off_t need this sort of fixup. See 'read' and 'write' which just use the native versions for example. I don't think these calls need any sort of wrapper but the native versions should just work. -- John Baldwin