summaryrefslogtreecommitdiff
path: root/ext2fs
AgeCommit message (Collapse)Author
2025-04-28ext2fs: fix crash on ENOSPCSamuel Thibault
54c0b9b9dbf7 ("ext2fs: Trap trying to access bogus data areas") added checks on the allocated block number, but did not take care of the out-of-space condition, which callers of ext2_new_block and ext2_alloc_block know to handle.
2025-04-19libdiskfs: Fix catching exceptionsv0.9.git20250420Samuel Thibault
This fixes making diskfs_catch_exception recursive, catching the last fault exception, and fixes callers.
2025-03-18ext2fs: Always clean just-allocated inodeSamuel Thibault
So that if we get a lazily-cleaned inode, we do not get disturbed by the values, notably i_file_acl and i_dir_acl were not cleaned, and i_block_group not checked. b0ff48880bb40 ("Formerly ialloc.c.~6~") introduced only setting dn_set_ctime when cleanup was missing, but we always want to set the ctime for a new inode anyway.
2025-03-18ext2fs: extend end check for ext2_free_blocksSamuel Thibault
Since it can free more than one block.
2025-03-18ext2fs: Do not try to frob inline data for regular files and directoriesSamuel Thibault
Inline data in i_data is only used by symlinks (and apparently some device nodes in linux). For regular files and directories we don't store data there. This is actually important since otherwise int fd = open("foo.txt", O_WRONLY|O_CREAT); ftruncate(fd, 1024); ftruncate(fd, 10); leads to trying to frob beyond i_data end.
2025-03-18ext2fs: Trap trying to access bogus data areasSamuel Thibault
i.e. superblock, block group descriptor table or beyond the end.
2025-03-13ext2fs: Trap trying to access bogus data areasSamuel Thibault
i.e. superblock, block group descriptor table or beyond the end.
2025-03-13Revert "ext2fs: Fix failed assertion on ENOSPC"Samuel Thibault
This reverts commit 86ea895b1a208925dfc034fac22db2a512a3fab8. We are really not supposed to have failed to find the block here, it should have been allocated by pager_unlock_page already.
2025-03-08ext2fs: Fix failed assertion on ENOSPCSamuel Thibault
find_block ignores EINVAL errors, we need to reconstruct it
2025-01-11libdiskfs: catch mmap failureSamuel Thibault
Just backtrace for now
2024-08-26ext2fs: Ignore translators bits when checking we have no Hurd extensionsSamuel Thibault
We don't actually want to write these anyway.
2024-08-26ext2fs: Fix masking out translators bitsSamuel Thibault
We need to mask out before shifting the bits.
2024-08-26ext2fs: mention which inode size is supportedSamuel Thibault
2024-03-12ext2fs: support translators on non-hurd-created filesystemsSamuel Thibault
We are fine with only using xattr on filesystems that don't have the i_translator inode field.
2024-03-05ext2fs: New default: use xattrs to store translator recordsDamien Zammit
Replaces experimental option --x-xattr-translator-records with --no-xattr-translator-records to allow rolling back to previous behaviour. NB: - Legacy records still work with either setting. - Adding a new record removes a legacy one.
2024-03-04ext2fs: Check that the filesystem supports xattr before reading itDamien Zammit
2023-12-29Initialize a few error variables to avoid GCC warningsFlavio Cruz
Message-ID: <20231229212105.858759-1-flaviocruz@gmail.com>
2023-12-17Update server handlers to return kern_return_error to fix ↵v0.9.git20231217Flavio Cruz
-Werror=enum-int-mismatch warnings MiG expects those to return kern_return_t. Message-ID: <ZXqbbXpVqQAwd2qv@jupiter.tail36e24.ts.net>
2023-08-08ext2fs: Fix shift in find_next_zero_bitSamuel Thibault
Shifting unsigned 32bit right by 32 bits is undefined, so avoid this.
2023-08-08ext2fs: Fix shift in ext2_new_blockSamuel Thibault
Shifting signed integers left by 31 bits is not representable, so better make sure to use unsigned integers.
2023-08-08Homogeneize [gs]et_translator and get_dire[nc]ts into mach_msg_type_number_tSamuel Thibault
This makes netfs_[gs]et_translator use mach_msg_type_number_t like the RPC and diskfs. This also makes the fshelp_fetch_root_callback1_t for fshelp_fetch_root use mach_msg_type_number_t. This also makes procfs_get_translator and the get_translator proc method use mach_msg_type_number_t. This makes diskfs_get_directs use mach_msg_type_number_t like the dir_readdir RPC Also get rid of u_int. This notably fixes _diskfs_translator_callback1_fn's bogus cast of size_t *argz_len into (u_int *).
2023-05-27ext2fs: Fix unsigned long / uint32_t confusionSamuel Thibault
2023-05-10ext2fs: Port to x86_64Sergey Bugaev
Message-Id: <20230508213136.608575-35-bugaevc@gmail.com>
2023-04-08Further modernize Hurd code by enforcing strict prototypes and no implicit ↵Flavio Cruz
function declarations. Most of the changes land in one of these buckets: * Removed unused declarations. * Used (void) to represent no parameters instead of () which means an undeterminate number of parameters. * Included missing header files whenever necessary (stdlib.h, sys/mman.h, etc) * Typedefed function pointers to be able to fully declare the parameter types. * Added declarations of library functions that are used elsewhere (example is libps/ps.h). * Made functions static whenever they are only used in that file. * Forwarded declarations of some methods that were made static. Message-Id: <ZDD1o7/tVYeZew+G@jupiter.tail36e24.ts.net>
2023-04-03Modernize code by removing use of old style definitions.Flavio Cruz
Also add -Werror=old-style-definition to enforce new code. Message-Id: <ZBZ+8xf7GHy2RT/h@jupiter.tail36e24.ts.net>
2023-02-02Avoid undefined-behaviorSamuel Thibault
1 << 31 is undefined behavior, 1 needs to be made unsigned for << 31 to be defined behavior.
2023-02-02ext2fs: use __alignof (struct dirent) instead of hardcoding 4Samuel Thibault
2023-01-19Fix some compiler warningsSvante Signell
2022-12-06Fix *printf specifier for user space mach ports.Flavio Cruz
mach_port_t are mach_port_name_t and thus require %u instead of %lu. Message-Id: <Y42RELMbulK4xaKM@reue>
2022-11-09Replace vsprintf with vsnprintf in ext2fs/msg.cFlavio Cruz
Message-Id: <Y2s/UPSCuGap3cv6@viriathus>
2022-08-10Do not cache the R/O proxySamuel Thibault
We cannot properly detect when to release the ro_proxy, so let's just not cache it.
2022-08-10ext2fs: Return read-only memory objects when appropriateSergey Bugaev
2022-01-23Change a EIO by a ENOSPC in case where not enough spaceEtienne Brateau
Return a ENOSPC to notify that not enough space is here after the xattr entry instead of returning an EIO. Message-Id: <20220123041715.19402-15-etienne.brateau@gmail.com>
2022-01-23ext2fs: refactor add a method for dupplicated codeEtienne Brateau
* xattr: introduce xattr_header_valid method Message-Id: <20220123041715.19402-14-etienne.brateau@gmail.com>
2022-01-23ext2fs: detect and warn when filesystem is an ext3 fsEtienne Brateau
Message-Id: <20220123041715.19402-12-etienne.brateau@gmail.com>
2022-01-23ext2fs: resolve a todo, check writability before writingEtienne Brateau
Message-Id: <20220123041715.19402-11-etienne.brateau@gmail.com>
2022-01-23ext2fs: set the writing time in the superblockEtienne Brateau
Message-Id: <20220123041715.19402-10-etienne.brateau@gmail.com>
2022-01-23ext2fs: set the f_namelen to the correct valueEtienne Brateau
Message-Id: <20220123041715.19402-9-etienne.brateau@gmail.com>
2022-01-23ext2fs: Take cares of indiannesEtienne Brateau
In ext2 data are stored in little endian to ensure portability. So enforce little endian when manipulating these bytes. Message-Id: <20220123041715.19402-8-etienne.brateau@gmail.com>
2022-01-23ext2fs: use macro to check flagsEtienne Brateau
* hyper.c: use macros to check flags Message-Id: <20220123041715.19402-7-etienne.brateau@gmail.com>
2022-01-23ext2fs: remove unneeded fileEtienne Brateau
Message-Id: <20220123041715.19402-5-etienne.brateau@gmail.com>
2022-01-23move to ext2_fs.h a #defineEtienne Brateau
This makes all #define be grouped at the same place Message-Id: <20220123041715.19402-4-etienne.brateau@gmail.com>
2022-01-23ext2fs: remove __KERNEL__Etienne Brateau
This makes the header more clear and btw it’s not anymore in the linux tree Message-Id: <20220123041715.19402-3-etienne.brateau@gmail.com>
2022-01-23ext2fs: update ext2_fs.h headerEtienne Brateau
Message-Id: <20220123041715.19402-2-etienne.brateau@gmail.com>
2022-01-23ext2fs Merge 2 headersEtienne Brateau
* ext2_fs_i.h: merge it into ext2_fs.h. This is also done in the linux tree Message-Id: <20220123041715.19402-1-etienne.brateau@gmail.com>
2022-01-18ext2fs: fix invalid checkEtienne Brateau
log2_dev_block_per_fs_block is unsigned so it won’t never be less than 0 and the check is then always false. Instead check the two values directly before doing the substraction. Message-Id: <20220118211140.8837-1-etienne.brateau@gmail.com>
2021-08-12ext2fs: Disable an expensive checkSamuel Thibault
disk_cache_block_is_ref calls hurd_ihash_find which is very expensive, so better disable the checks from record_global_poke and record_indir_poke unless building a debugging version.
2021-08-11ext2fs: clear inline dataSamuel Thibault
When truncating a node with inline data, it's safer to really frob the inline data, to make sure ext2fs does not wrongly interprete it as block numbers.
2021-08-11ext2fs: Fix block allocation on symlink->translator conversionSamuel Thibault
In diskfs_set_translator we need to truncate the existing node before allocating the block for the translator.
2021-08-11ext2fs: clear data when setting a translator on a symlinkv0.9.git20210811Samuel Thibault
e2fsck does not like seeing both blocks for the symlink and for the translation entry. This fixes the disappearance of /dev/urandom.