aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* MAKEDEV: use bashSamuel Thibault2020-11-141-1/+1
| | | | | | dash's expandarg always calls expandmeta which calls glob64, which stats the parameters. This is dangerous for MAKEDEV since it triggers the translator, which may be strictly unwanted when filling an installed system.
* rumpdisk: Support opening a device several timesSamuel Thibault2020-11-141-55/+58
| | | | | | | | | | * rumpdisk/block-rump.c (struct block_data): Make taken field an integer instead of a boolean. (device_open): When search_bd succeeds, set a new reference and return a new port right. Separate out io_return_t err, int fd, and int ret to avoid confusions. Simplify the error handling path. (device_close): Decrement reference and close rump disk only when reaching zero. Also destroy our port.
* libmachdev: Avoid conflating translator name and pathSamuel Thibault2020-11-143-5/+6
| | | | | | | | | | | | bootstrap translators may not wish to appear in the FS, and the name of the translator does not have to match the path where it is getting installed. * libmachdev/machdev.h (machdev_trivfs_init): Add path parameter. * libmachdev/trivfs_server.c (machdev_trivfs_init): Add path parameter, set devnode only if it is not NULL. (trivfs_S_fsys_init): Only call install_as_translator when devnode is not NULL. * /rumpdisk/main.c (main): Add path parameter.
* libmachdev: Support installing translator in the FSDamien Zammit2020-11-142-24/+63
| | | | | | | | | | | | | | | | | */libmachdev/trivfs_server.c (machdev_ctl): Rename to control_port. (trivfs_S_fsys_init): Fix accordingly. (control): New variable. (bootstrapped, underlying, devnode): New variables. (install_as_translator): New function. (trivfs_S_fsys_init): When bootstrapping, call install_as_translator. (machdev_trivfs_init): Create one port of the control class. (trivfs_S_fsys_getpriv): Use ports_get_send_right on the control port instead of creating another one. (resume_bootstrap_server): Use ports_get_send_right on the control port instead of creating another one. (machdev_trivfs_init): When bootstrapping, Use our control port as fsys.
* rumpdisk: Comment on thread-safety requirementsSamuel Thibault2020-11-141-0/+3
|
* Remove remnants of cthreadsSamuel Thibault2020-11-116-50/+4
| | | | | | | | | | * doc/hurd.texi: Index pthread.h instead of cthreads.h * libports/Makefile (SRCS): Drop stubs.c. * libports/stubs.c: Remove file. * mach-defpager/default_pager.c (default_pager): Drop disabled cthreads calls. * pfinet/kmem_cache.c: Fix comment. * proc/stubs.c: Fix comments.
* pflocal: Set default uid/gid to those of the translatorSamuel Thibault2020-11-111-2/+2
| | | | | * pflocal/sock.c (sock_create): Set uid to getpid () and gid to getgid ().
* pflocal: Record socket creator so io_stat can return itSamuel Thibault2020-11-115-2/+22
| | | | | | | | | | | * pflocal/sock.h (struct sock): Add uid and gid fields. * pflocal/sock.c (sock_create): Set uid and gid to 0. * pflocal/mig-mutate.h (SOCKET_IMPORTS): Import ../libtrivfs/mig-decls.h. (PF_INTRAN, PF_INTRAN_PAYLOAD, PF_DESTRUCTOR): New macros. * pflocal/pf.c: Include hurd/trivfs.h. (S_socket_create): Update parameters. Set sock's uid and gid fields according to pf->user. * pflocal/io.c (S_io_stat): Set st_uid and st_gid according to pf.
* libthreads: Finish emovingSamuel Thibault2020-11-112-14/+0
| | | | | * config.make.in (VERSIONING): Remove. * configure.ac: Do not set VERSIONING.
* libthreads: RemoveSamuel Thibault2020-11-1134-5502/+7
| | | | | | | | | | | | | | | libthreads is most probably completely broken, and not the long-term road anyway. * config.make.in (VERSIONING): Remove. * configure.ac: Test for pfinet assembly compatibility instead of libthreads assembly compatibility. Do not set VERSIONING. * libthreads: Remove directory. * Makefile (lib-subdirs): Remove libthreads. * doc/hurd.texi (Threads Library): Rename references to libthreads into libpthread. * release/rfloppy.copy: Do not objcopy lib/libthreads.so. * release/tool-Makefile (rfloppy-solib): Remove libthreads.
* rumpdisk: Use rump_sys_pread/pwrite instead of lseek+r/w for atomic accessesDamien Zammit2020-11-091-17/+4
| | | | | | TESTED by booting a QEMU passthrough disk via rumpdisk.static Message-Id: <20201109070906.20796-1-damien@zamaudio.com>
* libdiskfs: enable relatime by defaultSamuel Thibault2020-10-102-2/+2
| | | | | | | | | Like Linux does, to avoid writing inodes when just reading files already in the cache. * libdiskfs/init-init.c (_diskfs_relatime): Set to 1. * libdiskfs/opts-std-runtime.c (set_opts): Always _diskfs_relatime from h->relatime.
* libdiskfs: Make relatime also update atime when equal to mtime/ctimeSamuel Thibault2020-10-031-2/+2
| | | | | | | Some tests (such as glibc's tst-atime) require it for instance. * libdiskfs/node-times.c (atime_should_update): Also return 1 when atime is equal to mtime or ctime.
* libdiskfs: Add relatime supportRyan Jeffrey2020-09-3012-12/+93
| | | | | | | | | | | | | | | | | | | | | | | | * doc/hurd.texi (diskfs_set_node_atime): Document relatime behavior. * libdiskfs/diskfs.h (diskfs_set_node_atime): Likewise. * libdiskfs/init-init.c (_diskfs_relatime): Add variable. * libdiskfs/file-statfs.c (ST_RELATIME): Define if not defined already. (diskfs_S_file_statfs): Report ST_RELATIME when _diskfs_relatime is set. * libdiskfs/node-times.c (atime_should_update): New function. (diskfs_set_node_atime): Document relatime behavior. Call atime_should_update instead of reading _diskfs_noatime. * libdiskfs/opts-common.c (diskfs_common_options): Add --strictatime and -R/--relatime options. * libdiskfs/opts-std-runtime.c (struct parse_hook): Add relatime field. (set_opts): Set _diskfs_relatime from relatime field. (parse_opt): Parse -R option. * libdiskfs/opts-std-startup.c (parse_startup_opt): Parse -R option. * libdiskfs/priv.h (_diskfs_relatime): Declare variable. (atime_should_update): Declare function. * libdiskfs/opts-append-std.c (diskfs_append_std_options): Add reporting --relatime option. * libdiskfs/conch-fetch.c (iohelp_fetch_shared_data): Call atime_should_update instead of reading _diskfs_noatime. * libdiskfs/rdwr-internal.c (_diskfs_rdwr_internal): Likewise.
* pci-arbiter: Probe devices and map regionsJoan Lledó2020-09-132-9/+30
| | | | | | | | | | | This adapts the arbiter to a bug fixed in libpciaccess. We were relying on the library to probe devices and map regions but it's the arbiter who should do it. * pci-arbiter/pcifs.c: * create_fs_tree(): probe the device to find regions and rom * pci-arbiter/func_files.c: * io_region_file(): map region on the first access attempt
* libmachdev: Remove declaration for static functionDamien Zammit2020-09-061-2/+0
| | | | | | This one-liner fixes libmachdev build failure. Message-Id: <20200906020837.329023-1-damien@zamaudio.com>
* libpipe: Enforce write_limit for large writesSamuel Thibault2020-08-071-15/+44
| | | | | | | | We are not supposed to buffer more than the requested buffer size, so we should make the writer wait. * libpipe/pipe.c (pipe_send): Limit write calls to the write_limit, and loop around it to reach the requested amount.
* libmachdev: Introduce startup notification for clean rumpdisk shutdownDamien Zammit2020-08-027-6/+177
| | | | Message-Id: <20200801050538.273196-1-damien@zamaudio.com>
* usermux: Fix extern inline usageSamuel Thibault2020-08-011-1/+1
| | | | | | | | C99 extern inline semantic is different from GNU semantic, so we cannot blindly write "extern inline". * usermux/usermux.h (USERMUX_EI): Define to __extern_inline instead of extern inline.
* libfshelp: Fix extern inline usageSamuel Thibault2020-08-013-2/+7
| | | | | | | | | | | | C99 extern inline semantic is different from GNU semantic, so we cannot blindly write "extern inline". * libfshelp/rlock.h (FSHELP_EXTERN_INLINE): Define to __extern_inline if not already. (rlock_list_init): Mark FSHELP_EXTERN_INLINE instead of extern inline. * libfshelp/fshelp.h (FSHELP_EXTERN_INLINE): Define to __extern_inline instead of extern inline. * libfshelp/extern-inline.c: Include "rlock.h"
* libfshelp: Fix extern inline definitionsSamuel Thibault2020-08-011-3/+3
| | | | | | * libfshelp/fshelp.h (fshelp_rlock_init, fshelp_rlock_po_init, fshelp_rlock_po_fini): Define when FSHELP_DEFINE_EXTERN_INLINE is defined, not DISKFS_DEFINE_EXTERN_INLINE.
* diskfs: Add RPC for fsys_init to bootstrap if presentDamien Zammit2020-07-311-0/+13
| | | | Message-Id: <20200728100837.224336-1-damien@zamaudio.com>
* diskfs: Don't deallocate if dotdot is null in fsys-getroot.cDamien Zammit2020-07-311-1/+2
| | | | Message-Id: <20200728100837.224336-2-damien@zamaudio.com>
* libdiskfs: Refactor fsys_startup invokation for bootstrappingDamien Zammit2020-07-281-20/+38
| | | | | | | When we will have a rump translator before the root filesystem translator, we will want to give to the former a control port on the latter. Message-Id: <20200726073721.202405-1-damien@zamaudio.com>
* libmachdev: simplify source codeSamuel Thibault2020-07-251-19/+8
| | | | | * libmachdev/trivfs_server.c (machdev_is_master_device): Simplify source code.
* Fix references to startup in commentsSamuel Thibault2020-07-253-4/+4
|
* rumpdisk: Use bootstrap resume of fs task in machdevDamien Zammit2020-07-252-11/+123
| | | | Message-Id: <20200725011847.186969-4-damien@zamaudio.com>
* libmachdev: Implement S_i386_io_perm_createDamien Zammit2020-07-253-1/+65
| | | | | | | | Now that machdev redirects the device master port, it has to implement the i386 permission RPCs on it. Message-Id: <20200725011847.186969-2-damien@zamaudio.com> Message-Id: <20200725011847.186969-3-damien@zamaudio.com>
* libmachdev: Add resume for bootstrap serverDamien Zammit2020-07-253-26/+148
| | | | | | | | | | | | machdev users can now pass along a port to the next translator in the bootstrap chain (bootstrap_resume_task), that they'll get from their command line set by the bootloader. machdev will then call task_resume on it as appropriate. It will also have the opportunity to get fsys_getpriv calls, and thus redirect the device master port, thus having the opportunity to expose its devices on the device master port, as if they were handled by the kernel. Message-Id: <20200725011847.186969-1-damien@zamaudio.com>
* libmachdev: Remove deviceUser, this lib is a deviceServerDamien Zammit2020-07-241-3/+3
| | | | | libmachuser provides what we need Message-Id: <20200724132039.110421-1-damien@zamaudio.com>
* Add new RPC server stubs for device_intr_*Samuel Thibault2020-07-183-0/+42
| | | | | | | * boot/boot.c (ds_device_intr_register, ds_device_intr_ack): New stubs. * devnode/devnode.c (ds_device_intr_register, ds_device_intr_ack): New stubs. * eth-multiplexer/device_impl.c (ds_device_intr_register, ds_device_intr_ack): New stubs.
* rumpdisk: link the bd on success onlyDamien Zammit2020-07-181-2/+2
| | | | Otherwise we would crash after an unsuccessful device_open call.
* rumpdisk: Simplify codeDamien Zammit2020-07-181-4/+1
| | | | There is no need to store the error only to return it.
* libmachdev: Add new RPC server stubs for ds_device_intr_*Damien Zammit2020-07-181-0/+13
|
* pflocal: Fix referencing connection queue entries.Samuel Thibault2020-07-051-2/+13
| | | | | | | | | | As asserted in connq_destroy, for each entry in the queue we are supposed to keep a reference to the socket that contains the queue. So we need to keep it when connecting and release it when accepting. * pflocal/socket.c (S_socket_connect): Do not deref the peer socket when sock_connect succeeded. (S_socket_accept): Deref the socket when the accept succeeded.
* pflocal: support SO_SNDBUF for unconnected socketsSamuel Thibault2020-07-053-7/+13
| | | | | | | | | | | | | | We can store the requested value, to be applied when we connect the sockets. * pflocal/sock.h (struct sock): Add req_write_limit field. * pflocal/sock.c (sock_create): Initialize req_write_limit field to 0. (sock_connect): Bump the write_limit of the write pipe to the req_write_limit value. (sock_shutdown): Update req_write_limit from the write_limit of the write pipe. * pflocal/socket.c (S_socket_getopt, S_socket_setopt): When write_pipe is NULL, use req_write_limit.
* pflocal: return ENOTCONN on get/setpot(SO_SNDBUF) on unconnected socketSamuel Thibault2020-07-051-4/+4
| | | | | | | | EPIPE would raise SIGPIPE, which applications do not expect to happen on a mere get/setsockopt. * pflocal/socket.c (S_socket_getopt, S_socket_setopt): Return ENOTCONN instead of EPIPE.
* pflocal: Fix setsockopt(SO_SNDBUF)Samuel Thibault2020-06-271-1/+1
| | | | | * pflocal/socket.c (S_socket_setopt): Make SO_SNDBUF use write_pipe instead of read_pipe.
* pflocal: Add support for setsockopt(SO_{RECV,SND}BUF)Samuel Thibault2020-06-274-14/+108
| | | | | | | | | | Thanks Svante Signell for the initial patch. * libpipe/pipe.c (pipe_recv): Move writer wake code to... (_pipe_wake_writers): ... new function. * libpipe/pipe.h (_pipe_wake_writers): New prototype. * pflocal/sock.h (PFLOCAL_WRITE_LIMIT_MAX): New macro. * pflocal/socket.c (S_socket_setopt): Handle SO_RCVBUF and SO_SNDBUF cases.
* pflocal: Fix crash on passing erroneous portSamuel Thibault2020-06-271-1/+3
| | | | | * pflocal/socket.c (S_socket_getopt): Read `user->sock' after checking `user'.
* pflocal: Add support for getsockopt(SO_{RECV,SND}BUF)Svante Signell2020-06-271-3/+35
| | | | * S_socket_getopt: Handle SO_RCVBUF and SO_SNDBUF cases.
* TODO: drop items that were doneSamuel Thibault2020-06-061-3/+0
| | | | TLS, sigaltstack, gdb core
* libfshelp: destroy condition variable before freeing itSamuel Thibault2020-06-012-0/+2
| | | | | | | | | | To make sure that threads have really woken up. Spotted by Richard Braun. * libfshelp/rlock-drop-peropen.c (fshelp_rlock_drop_peropen): Call pthread_cond_destroy before freeing the condition variable. * libfshelp/rlock-tweak.c (fshelp_rlock_tweak): Likewise.
* libdiskfs: Add missing node lock around fshelp_rlock_drop_peropen callSamuel Thibault2020-06-012-5/+6
| | | | | fshelp_rlock_drop_peropen actually needs the node to be locked for proper waiting atomicity.
* libdiskfs: Drop spurious mutex acquisitionSamuel Thibault2020-06-011-2/+0
| | | | | | | | diskfs_make_peropen does not need node to be locked. Worse, it could try to lock it. * libdiskfs/file-reparent.c (diskfs_S_file_reparent): Do not lock node around diskfs_make_peropen.
* libdiskfs,libnetfs: add missing io_pathconf casesSamuel Thibault2020-05-282-0/+20
| | | | | | | | * libdiskfs/io-pathconf.c (diskfs_S_io_pathconf): For _PC_REC_MAX_XFER_SIZE, _PC_REC_INCR_XFER_SIZE, _PC_SYMLINK_MAX, return undefined. For _PC_2_SYMLINKS, return 1. For _PC_REC_MIN_XFER_SIZE, _PC_REC_XFER_ALIGN, _PC_ALLOC_SIZE_MIN, return page size. * libnetfs/io-pathconf.c (netfs_S_io_pathconf): Likewise.
* ext2fs: Update to upstream Hurd-reserved xattr index for "gnu.*".Jan (janneke) Nieuwenhuizen2020-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3980bd3b406addb327d858aebd19e229ea340b9a This supports setting (and reading) of passive trasnlators from GNU/Linux, e.g. dd if=/dev/zero of=file bs=1k count=1000 losetup /dev/loop0 file mke2fs -t ext2 -o hurd -O ext_attr /dev/loop0 mount -t ext2 -o x-xattr-translator-records /dev/loop0 /mnt mkdir -p /mnt/servers/socket touch /mnt/servers/socket/1 setfattr --name=gnu.translator --value='"/hurd/pflocal\0"' /mnt/servers/socket/1 getfattr --name=gnu.translator /mnt/servers/socket/1 # file: 1 gnu.translator="/hurd/pflocal" * ext2fs/xattr.c (xattr_prefixes): For "gnu.*", use index for the Hurd (10).
* pci-arbiter: Remove obsolete TODO itemsJoan Lledó2020-05-021-5/+0
| | | | | * pci-arbiter/TODO: Remove --pci and memset+snprintf TODO items which are already done.
* Memset directory entries to zero during their creationJoan Lledó2020-05-021-1/+2
| | | | | | | * pci-arbiter/pcifs.c: * create_dir_entry: Add memset() * create_fs_tree: Remove memset() Message-Id: <20200502172713.18654-2-jlledom@mailfence.com>
* Really enable building rumpdiskSamuel Thibault2020-04-161-0/+3
| | | | * config.make.in (HAVE_LIBRUMP): Define.