Age | Commit message (Collapse) | Author |
|
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.
|
|
This fixes making diskfs_catch_exception recursive, catching the last
fault exception, and fixes callers.
|
|
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.
|
|
Since it can free more than one block.
|
|
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.
|
|
i.e. superblock, block group descriptor table or beyond the end.
|
|
i.e. superblock, block group descriptor table or beyond the end.
|
|
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.
|
|
find_block ignores EINVAL errors, we need to reconstruct it
|
|
Just backtrace for now
|
|
We don't actually want to write these anyway.
|
|
We need to mask out before shifting the bits.
|
|
|
|
We are fine with only using xattr on filesystems that don't have the
i_translator inode field.
|
|
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.
|
|
|
|
Message-ID: <20231229212105.858759-1-flaviocruz@gmail.com>
|
|
-Werror=enum-int-mismatch warnings
MiG expects those to return kern_return_t.
Message-ID: <ZXqbbXpVqQAwd2qv@jupiter.tail36e24.ts.net>
|
|
Shifting unsigned 32bit right by 32 bits is undefined, so avoid this.
|
|
Shifting signed integers left by 31 bits is not representable, so better
make sure to use unsigned integers.
|
|
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 *).
|
|
|
|
Message-Id: <20230508213136.608575-35-bugaevc@gmail.com>
|
|
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>
|
|
Also add -Werror=old-style-definition to enforce new code.
Message-Id: <ZBZ+8xf7GHy2RT/h@jupiter.tail36e24.ts.net>
|
|
1 << 31 is undefined behavior, 1 needs to be made unsigned for << 31 to
be defined behavior.
|
|
|
|
|
|
mach_port_t are mach_port_name_t and thus require %u instead of %lu.
Message-Id: <Y42RELMbulK4xaKM@reue>
|
|
Message-Id: <Y2s/UPSCuGap3cv6@viriathus>
|
|
We cannot properly detect when to release the ro_proxy, so let's just not
cache it.
|
|
|
|
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>
|
|
* xattr: introduce xattr_header_valid method
Message-Id: <20220123041715.19402-14-etienne.brateau@gmail.com>
|
|
Message-Id: <20220123041715.19402-12-etienne.brateau@gmail.com>
|
|
Message-Id: <20220123041715.19402-11-etienne.brateau@gmail.com>
|
|
Message-Id: <20220123041715.19402-10-etienne.brateau@gmail.com>
|
|
Message-Id: <20220123041715.19402-9-etienne.brateau@gmail.com>
|
|
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>
|
|
* hyper.c: use macros to check flags
Message-Id: <20220123041715.19402-7-etienne.brateau@gmail.com>
|
|
Message-Id: <20220123041715.19402-5-etienne.brateau@gmail.com>
|
|
This makes all #define be grouped at the same place
Message-Id: <20220123041715.19402-4-etienne.brateau@gmail.com>
|
|
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>
|
|
Message-Id: <20220123041715.19402-2-etienne.brateau@gmail.com>
|
|
* 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>
|
|
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>
|
|
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.
|
|
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.
|
|
In diskfs_set_translator we need to truncate the existing node before
allocating the block for the translator.
|
|
e2fsck does not like seeing both blocks for the symlink and for the
translation entry.
This fixes the disappearance of /dev/urandom.
|