summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-08-31Fix build against glibc 2.21Samuel Thibault
* Makeconf (CPPFLAGS): Remove -D_IO_MTSAFE_IO. * libthreads/lockfile.c (_IO_MTSAFE_IO): Define macro. (IS_IN): Define macro to 0.
2015-08-25libdiskfs: rename `error' variableJustus Winter
* libdiskfs/dir-lookup.c (diskfs_S_dir_lookup): Rename `error' to `err'. * libdiskfs/file-getcontrol.c (diskfs_S_file_getcontrol): Likewise. * libdiskfs/file-syncfs.c (diskfs_S_file_syncfs): Likewise.
2015-08-25libdiskfs: add missing declarationsJustus Winter
* libdiskfs/diskfs.h (diskfs_node_disknode): Add missing declaration. (diskfs_disknode_node): Likewise.
2015-08-25libdiskfs: fix typoJustus Winter
* libdiskfs/diskfs.h: Fix typo.
2015-08-20libdiskfs: fix parent lookup in the name cacheJustus Winter
* libdiskfs/name-cache.c (diskfs_check_lookup_cache): Drop stray negation.
2015-08-15ext2fs: provide unconditional debug macroJustus Winter
* ext2fs/ext2fs.h (ext2_debug_): New macro that unconditionally prints the given message. (ext2_debug): Use the new macro.
2015-08-15ext2fs: improve ext2fs debuggingJustus Winter
* ext2fs/ext2fs.h (ext2_debug): Print to stderr. (printf): Drop declaration.
2015-08-14Fake full file access only for faked nodesSamuel Thibault
Otherwise some scripts may try to modify system files just because they find they seem to be able to. * trans/fakeroot.c (netfs_report_access): When FAKE_MODE is not set on `np', call file_check_access on the underlying node instead of returning O_RDWR|O_EXEC.
2015-08-14Make fakeroot return file types from underly fsSamuel Thibault
Fakeroot does not support faking them anyway, and they may change on the underlying fs, e.g. when creating a local socket. * trans/fakeroot.c (netfs_validate_stat): Return S_IFMT part of st_mode as provided by underlying filesystem.
2015-08-14libports: clarify why we emulate protected payloadsJustus Winter
The Hurd uses protected payloads to improve the receiver lookup on the server side to the point that we no longer do a hash table lookup in the dispatch code. If the kernel does not support protected payloads, we degrade gracefully, do one lookup in libports' dispatching code, and emulate the protected payload feature to still save one hash table lookup in the intrans function. * libports/manage-multithread.c (ports_manage_port_operations_multithread): Add comment. * libports/manage-one-thread.c (ports_manage_port_operations_one_thread): Likewise.
2015-08-14pflocal: fix receiver lookupJustus Winter
* pflocal/mig-decls.h (begin_using_addr_payload): Use `ports_lookup_payload'.
2015-08-08Print which path init tried to execvSamuel Thibault
* init/init.c (main): On execv failure, print which path failed.
2015-07-14exec: fix setting the name of early serversJustus Winter
Previously, the exec server did not set the name of the servers started before the proc server. Instead this was done by the startup server, but this was merely a workaround, missing notably the startup server itself. * exec/exec.c (set_name): New function. (do_exec): Move the code setting the name to a new function, and also call it if the proc server is not started yet. * startup/startup.c (run): Drop hack.
2015-07-04Do not keep mutex locked while waiting for authenticate loopSamuel Thibault
* libdiskfs/io-reauthenticate.c (diskfs_S_io_reauthenticate): Release the node lock while blocking on the auth server and client. * libnetfs/io-reauthenticate.c (netfs_S_io_reauthenticate): Likewise. * pfinet/io-ops.c (S_io_reauthenticate): Likewise.
2015-06-30utils/rpcscan: new utilityJustus Winter
* utils/rpcscan.c: New file. * utils/Makefile: Add `rpcscan'.
2015-06-30utils: split-off the message id parsingJustus Winter
* utils/rpctrace.c: Move all the code handling the message id files... * utils/msgids.c: ... to a new file. * utils/msgids.h: And add the relevand declarations. * utils/Makefile (SRCS): Add the new file.
2015-06-17Cope with scripts which chmod -x directoriesSvante Signell
As well as other potential mode changes which are indeed supposed to still work as root. * trans/fakeroot.c (netfs_attempt_chmod): Always set S_IRUSR and S_IWUSR in real_mode, and set S_IXUSR also when this is a directory.
2015-06-05Fix ps -o %r infinite loopEsa Peuha
* libps/fmt.c (_fmt_create): When nothing at all was recognized, break out instead of looping.
2015-06-05libdiskfs: do not print a message on ENOMEMJustus Winter
* libdiskfs/node-cache.c (diskfs_node_iterate): Do not print a message on ENOMEM.
2015-06-05Check AWK usability when XKB is enabledDiego Nieto Cid
* configure.ac: test whether AWK provides strtonum function.
2015-06-05console-client: Fix lower range of binary searchDiego Nieto Cid
To prevent infinite recursion range checking was introduced as an exit condition adding two extra comparisons on each recursive call. By fixing the range used by the recursive call over the lower half of the array one can avoid penalizing successful lookups while still preventing infinite recursion due to `first` parameter being greater than `last` parameter. * console-client/xkb/kstoucs.c (find_ucs): don't remove middle from the lower range. Remove extra comparisons.
2015-06-05console-client: assert preconditionDiego Nieto Cid
* console-client/xkb/kstoucs.c (find_ucs): assert precondition.
2015-05-23utils/vmstat: fix integer overflowJustus Winter
Previously, the `vmstat' utility would stop displaying the memory object hit ratio after some time due to an integer overflow. * utils/vmstat.c (get_memobj_hit_ratio): Fix integer overflow.
2015-05-23utils/rpctrace: fix build with -O0Justus Winter
* utils/Makefile: Link against `libshouldbeinlibc'.
2015-05-23console-client: fix binary searchJustus Winter
Previously, the binary search through the keysym map was incorrectly implemented. This resulted in infinite loops (thanks to the compilers tail call optimization) or crashes (if the stack space was exhausted). * console-client/xkb/kstoucs.c (find_ucs): Fix binary search.
2015-05-23console-client: avoid nested functionJustus Winter
* console-client/xkb/kstoucs.c (find_ucs): Previously, this function was a nested function for no reason at all. Turn it into a normal function.
2015-05-23console-client: fix build with -O0Justus Winter
* console-client/timer.h (fetch_jiffies): Make function `static inline'.
2015-05-23fakeroot: Fix reopening files after a chmodSamuel Thibault
Huge thanks to Svante Signell for having tracked the bug. * trans/fakeroot.c (netfs_attempt_chmod): Make the file_chmod call additionally include the modes from nn->openmodes.
2015-05-23Make comment clearerSamuel Thibault
* trans/fakeroot.c (check_openmodes): Make comment clearer about missing new openmodes.
2015-05-23Make sure to record only RWX open modesSamuel Thibault
Thanks Svante Signell for the investigation and proposed patch. * trans/fakeroot.c (new_node): Assert that `openmodes' includes only O_RDWR|O_EXEC (check_openmodes): Likewise with `newmodes'. (netfs_S_dir_lookup): Keep only O_RDWR|O_EXEC from `flags' when calling new_node.
2015-05-19fatfs: fix error handlingJustus Winter
* fatfs/dir.c (diskfs_dirrewrite_hard): Fix error handling.
2015-05-19libdiskfs: fix renaming of directoriesJustus Winter
Previously, file permissions and ownership of the target directory were ignored when renaming a directory: % mkdir a b % chmod 555 a % mv b a % ls a b * libdiskfs/dir-renamed.c (diskfs_rename_dir): Fix error handling.
2015-05-14Fix creating named sockets inside fakeroot-hurdSvante Signell
* trans/fakeroot.c (netfs_set_translator): New function.
2015-04-17fatfs: port to libdiskfs' node cacheJustus Winter
* fatfs/inode.c: Drop all cache-related code. (diskfs_user_make_node): New function. (diskfs_cached_lookup_in_dirbuf): Reimplement using the `lookup_context'. (read_node): Rename to diskfs_user_read_node and adopt accordingly. (diskfs_try_dropping_softrefs): Rename to `diskfs_user_try_dropping_softrefs'. (diskfs_node_reload): Pass context to `diskfs_user_read_node'. (diskfs_alloc_node): Pass `dir' via context to `diskfs_user_read_node'. * fatfs/fatfs.h (struct disknode): Drop fields `hnext', `hprevp'. (struct lookup_context): New definition. (ifind): Drop declaration. * fatfs/dir.c (diskfs_lookup_hard): Adjust accordingly. * fatfs/main.c (fetch_root): Likewise.
2015-04-17isofs: port to libdiskfs' node cacheJustus Winter
* isofs/inode.c: Drop all cache-related code. (diskfs_user_make_node): New function. (calculate_file_start): Check for `record' being null. (cache_id): New function. (read_node): Rename to diskfs_user_read_node and adopt accordingly. (diskfs_try_dropping_softrefs): Rename to diskfs_user_try_dropping_softrefs. * isofs/isofs.h (struct lookup_context): New definition. (cache_id): New declaration. * isofs/lookup.c (diskfs_lookup_hard): Adjust accordingly. * isofs/main.c (fetch_root): Likewise.
2015-04-17libdiskfs: implement a node cacheJustus Winter
Previously, all users of libdiskfs implemented a node cache on their own. Move the node cache from ext2fs into libdiskfs. We preserve the previous API by marking all functions that we pull from ext2fs as weak, so that users like tmpfs can still implement their own node cache. * ext2fs/dir.c (diskfs_lookup_hard): Adjust accordingly. * ext2fs/ext2fs.c (main): Don't call `inode_init'. * ext2fs/ext2fs.h (struct disknode): Drop `hnext', `hprevp'. * ext2fs/inode.c: Move the node cache into diskfs. (diskfs_user_make_node): New function. (diskfs_try_dropping_softrefs): Rename to `diskfs_user_try_dropping_softrefs'. (read_node): Rename to `diskfs_user_read_node'. Also move a chunk of code dealing with generations from `diskfs_cached_lookup' here. * libdiskfs/Makefile (OTHERSRCS): Add `node-cache.c'. * libdiskfs/diskfs.h (struct node): Add `hnext', `hprevp'. Amend existing comments, add forward declarations. * libdiskfs/node-cache.c: New file.
2015-04-17ext2fs: use fat nodesJustus Winter
Use `diskfs_make_node_alloc' to allocate both the node and the disknode in a continuous chunk of memory. This increases locality and reduces the pressure on the memory allocator. * ext2fs/inode.c: Use `diskfs_node_disknode' to access the disknode. (diskfs_cached_lookup): Use `diskfs_make_node_alloc' to allocate the node. (diskfs_node_norefs): Only free `np'. * ext2fs/dir.c: Use `diskfs_node_disknode' to access the disknode. * ext2fs/ext2fs.h: Likewise. * ext2fs/getblk.c: Likewise. * ext2fs/ialloc.c: Likewise. * ext2fs/pager.c: Likewise. * ext2fs/truncate.c: Likewise.
2015-04-17libdiskfs: declare all inline functions as `extern inline'Justus Winter
* libdiskfs/diskfs.h (diskfs_node_disknode, diskfs_disknode_node): Declare functions as `extern inline' so that we can use them in other functions declared as `extern inline'.
2015-04-17libdiskfs: fix node initializationJustus Winter
* libdiskfs/node-make.c (init_node): Initialize flag `author_tracks_uid'.
2015-04-17libdiskfs: drop unused fields from struct nodeJustus Winter
* libdiskfs/diskfs.h (struct node): Drop unused fields from struct node.
2015-04-17libdiskfs: make struct node more compactJustus Winter
* libdiskfs/diskfs.h (struct node): Turn flags into a bit field.
2015-04-17libdiskfs: lock-less reference counting of nodesJustus Winter
* libdiskfs/diskfs.h (struct node): Use refcounts_t for reference counting. (diskfs_node_refcnt_lock): Remove. (diskfs_node_norefs,diskfs_drop_node): Change comments accordingly. * libdiskfs/init-init.c: Adjust accordingly. * libdiskfs/node-drop.c: Likewise. * libdiskfs/node-make.c: Likewise. * libdiskfs/node-nput.c: Likewise. * libdiskfs/node-nputl.c: Likewise. * libdiskfs/node-nref.c: Likewise. * libdiskfs/node-nrefl.c: Likewise. * libdiskfs/node-nrele.c: Likewise. * libdiskfs/node-nrelel.c: Likewise. * ext2fs/inode.c: Likewise. * fatfs/inode.c: Likewise. * isofs/inode.c: Likewise. * tmpfs/node.c: Likewise. * doc/hurd.texi: Likewise.
2015-04-17tmpfs: use a seperate lock to protect all_nodesJustus Winter
Previously, tmpfs used diskfs_node_refcnt_lock to serialize access to the all_nodes and some other related global state related to memory consumption. Use a separate lock to protect all_nodes, and atomic operations to access the state related to memory consumption. Adjust the reference counting accordingly. Every node in the all_nodes carries a light reference. When we are asked to give up that light reference, we reacquire our lock momentarily to check whether someone else reacquired a reference through the all_nodes. * tmpfs/tmpfs.h (num_files, tmpfs_space_used): Use atomic operations for these variables. (adjust_used): Use atomic operations. (get_used): New convenience function to atomically retrieve tmpfs_space_used. * tmpfs/node.c (all_nodes_lock): New lock. (diskfs_alloc_node): Use a separate lock to protect all_nodes. Adjust the reference counting accordingly. (diskfs_free_node): Likewise. (diskfs_cached_lookup):Likewise. (diskfs_node_iterate): Likewise. (diskfs_node_norefs): Do not remove the node from all_nodes. This actually looks like a mistake, I do not know why they did that here as well as in diskfs_free_node. (diskfs_try_dropping_softrefs): Check whether someone reacquired a reference, and if so hold on to our light reference. (diskfs_grow): Use atomic operations. * tmpfs/tmpfs.c (diskfs_set_statfs): Likewise.
2015-04-17isofs: use a seperate lock to protect node_cacheJustus Winter
Previously, isofs used diskfs_node_refcnt_lock to serialize access to the node_cache. Use a separate lock to protect node_cache. Adjust the reference counting accordingly. Every node in the node_cache carries a light reference. When we are asked to give up that light reference, we reacquire our lock momentarily to check whether someone else reacquired a reference through the node_cache. * isofs/inode.c (nodecache_lock): New lock. (inode_cache_find): Use a separate lock to protect node_cache. Adjust the reference counting accordingly. (diskfs_cached_lookup): Likewise. (load_inode): Likewise. (cache_inode): Update comment accordingly. (diskfs_node_iterate): Likewise. (diskfs_node_norefs): Move the code removing the node from node_cache... (diskfs_try_dropping_softrefs): ... here, where we check whether someone reacquired a reference, and if so hold on to our light reference.
2015-04-11fatfs: use a seperate lock to protect nodehashJustus Winter
Previously, fatfs used diskfs_node_refcnt_lock to serialize access to the nodehash. Use a separate lock to protect nodehash. Adjust the reference counting accordingly. Every node in the nodehash carries a light reference. When we are asked to give up that light reference, we reacquire our lock momentarily to check whether someone else reacquired a reference through the nodehash. * fatfs/inode.c (nodecache_lock): New lock. (diskfs_cached_lookup): Use a separate lock to protect nodehash. Adjust the reference counting accordingly. (ifind): Likewise. (diskfs_node_iterate): Likewise. (diskfs_node_norefs): Move the code removing the node from nodehash... (diskfs_try_dropping_softrefs): ... here, where we check whether someone reacquired a reference, and if so hold on to our light reference.
2015-04-11ext2fs: use a seperate lock to protect nodehashJustus Winter
Previously, ext2fs used diskfs_node_refcnt_lock to serialize access to the nodehash. Use a separate lock to protect nodehash. Adjust the reference counting accordingly. Every node in the nodehash carries a light reference. When we are asked to give up that light reference, we reacquire our lock momentarily to check whether someone else reacquired a reference through the nodehash. * ext2fs/inode.c (nodecache_lock): New lock. (diskfs_cached_lookup): Use a separate lock to protect nodehash. Adjust the reference counting accordingly. (ifind): Likewise. (diskfs_node_iterate): Likewise. (diskfs_node_norefs): Move the code removing the node from nodehash... (diskfs_try_dropping_softrefs): ... here, where we check whether someone reacquired a reference, and if so hold on to our light reference.
2015-04-10GNU Hurd 0.6.Thomas Schwinge
* configure.ac (AC_INIT): Set version to 0.6. * NEWS: Finalize for 0.6.
2015-04-08NEWS: mention that the init server has been splitJustus Winter
* NEWS: Mention that the init server has been split into the startup server and the init server.
2015-04-07procfs: fix runtime option parsingJustus Winter
* procfs/main.c (netfs_runtime_argp): Actually use the runtime option parser.
2015-04-07libports: use protected payloads to optimize the object lookupJustus Winter
* NEWS: Mention protected payloads. * libports/Makefile (SRCS): Add `port-deref-deferred.c'. * libports/create-internal.c (_ports_create_port_internal): Set the protected payload to the objects address. * libports/import-port.c (ports_import_port): Likewise. * libports/reallocate-from-external.c (ports_reallocate_from_external): Likewise. * libports/reallocate-port.c (ports_reallocate_port): Likewise. * libports/transfer-right.c (ports_transfer_right): Likewise. * libports/manage-multithread.c (ports_manage_port_operations_multithread): Use the protected payload for the object lookup if provided. Add thread pool management calls. * libports/manage-one-thread.c (ports_manage_port_operations_one_thread): Likewise. * libports/destroy-right.c (ports_destroy_right): Defer the dereferencing of outstanding send rights to avoid a port_info use-after-free. * libports/port-deref-deferred.c: New file. * libports/port-deref-deferred.h: Likewise. * libports/ports.h (struct port_bucket): New field `threadpool'. (ports_lookup_payload): Check `port_right'.