From owner-freebsd-current@FreeBSD.ORG Thu Jun 4 04:43:39 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 44220106566B for ; Thu, 4 Jun 2009 04:43:39 +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 E7BA78FC1F for ; Thu, 4 Jun 2009 04:43:38 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: (from root@localhost) by kientzle.com (8.14.3/8.14.3) id n544hTm7037155; Wed, 3 Jun 2009 21:43:29 -0700 (PDT) (envelope-from kientzle@freebsd.org) Received: from dark.x.kientzle.com (fw2.kientzle.com [10.123.1.2]) by kientzle.com with SMTP id jd2zbjwpn3san6n9p3jg2t6wi6; Wed, 03 Jun 2009 21:43:28 -0700 (PDT) (envelope-from kientzle@freebsd.org) Message-ID: <4A2750F0.3070106@freebsd.org> Date: Wed, 03 Jun 2009 21:43:28 -0700 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.21) Gecko/20090601 SeaMonkey/1.1.16 MIME-Version: 1.0 To: Dmitry Marakasov References: <20090604010719.GC15659@hades.panopticon> In-Reply-To: <20090604010719.GC15659@hades.panopticon> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: 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: Thu, 04 Jun 2009 04:43:39 -0000 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