Whamcloud - gitweb
Wenbin Lv [Thu, 12 Jun 2025 23:58:47 +0000 (19:58 -0400)]
po: update zh_CN.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Yuri Chornoivan [Thu, 12 Jun 2025 23:58:47 +0000 (19:58 -0400)]
po: update uk.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Göran Uddeborg [Thu, 12 Jun 2025 23:58:47 +0000 (19:58 -0400)]
po: update sv.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Мирослав Николић [Thu, 12 Jun 2025 23:58:47 +0000 (19:58 -0400)]
po: update sr.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Remus-Gabriel Chelu [Thu, 12 Jun 2025 23:58:47 +0000 (19:58 -0400)]
po: update ro.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Pedro Albuquerque [Thu, 12 Jun 2025 23:58:47 +0000 (19:58 -0400)]
po: update pt.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Jakub Bogusz [Thu, 12 Jun 2025 23:58:47 +0000 (19:58 -0400)]
po: update pl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Benno Schulenberg [Thu, 12 Jun 2025 23:58:46 +0000 (19:58 -0400)]
po: update nl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Samuel Thibault [Thu, 12 Jun 2025 23:58:46 +0000 (19:58 -0400)]
po: update fr.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Antonio Ceballos [Thu, 12 Jun 2025 23:58:46 +0000 (19:58 -0400)]
po: update es.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Petr Pisar [Thu, 12 Jun 2025 23:58:46 +0000 (19:58 -0400)]
po: update cs.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Thu, 12 Jun 2025 19:00:08 +0000 (15:00 -0400)]
fuse2fs: rename the inusefile option to lockfile
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 11 Jun 2025 16:44:01 +0000 (09:44 -0700)]
fuse2fs: fix error bailout in op_create
Tim Woodall pointed out that op_create returns garbage error codes if
the ext2fs_extent_open2 in op_create fails. Worse than that, it also
neglects to drop the bfl and leaks temp_path. Let's fix all that.
Cc: linux-ext4@vger.kernel.org # v1.43
Fixes:
81cbf1ef4f5dab ("misc: add fuse2fs, a FUSE server for e2fsprogs")
Reported-by: Tim Woodall <debianbugs@woodall.me.uk>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 11 Jun 2025 16:43:45 +0000 (09:43 -0700)]
libext2fs: fix spurious warnings from fallocate
generic/522 routinely produces error messages from fuse2fs like this:
FUSE2FS (sde): Illegal block number passed to ext2fs_test_block_bitmap #9321 for block bitmap for /dev/sde
Curiously, these don't actually result in errors being thrown up to the
kernel. Digging into the program (which was more difficult than it
needed to be because of the weird bitmap base + errcode weirdness)
produced a left record:
e_lblk = 16
e_pblk = 9293
e_len = 6
e_flags = 0
and a right record:
e_lblk = 45
e_pblk = 9321
e_len = 6
e_flags = 0
Thus we end up in the "Merge both extents together, perhaps?" section of
ext_falloc_helper. Unfortunately, the merge selection code isn't smart
enough to notice that the two mappings aren't actually physically
contiguous, so it scans the bitmap with a negative length, which is why
the assertion trips.
The simple fix here is not to try to merge the adjacent extents if
they're not actually physically contiguous.
Cc: linux-ext4@vger.kernel.org # v1.43
Fixes:
5aad5b8e0e3cfa ("libext2fs: implement fallocate")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Thu, 12 Jun 2025 16:33:44 +0000 (14:03 -0230)]
fuse2fs: correctly handle system errno values in __translate_error()
Fixes:
81cbf1ef4f5dab ("misc: add fuse2fs, a FUSE server for e2fsprogs")
Reported-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 10 Jun 2025 17:04:08 +0000 (13:04 -0400)]
debian: fix typo in fuse2fs.postrm which breaks a /usr-move mitigation
A space was accidenally introduced into the fuse2fs.postrm which
breaks the /usr-move replacement of fusext2 from an older legacy
package that had been abandoned upstream. Specifically, what was
broken was the cleanup of the protective diversions:
Unpacking fuse2fs (1.47.2-2) over (1.47.2-1+b1) ...
/var/lib/dpkg/info/fuse2fs.postrm: 6: test: failed-upgrade: unexpected operator
Addresses-Debian-Bug: #1107595
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 9 Jun 2025 19:49:52 +0000 (15:49 -0400)]
misc: teach fuse2fs the inusefile command-line option
The inusefile option is useful for scripts that want to know when
fuse2fs is done modifying the file system after it is unmounted.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 9 Jun 2025 15:30:48 +0000 (11:30 -0400)]
libext2fs: fix integer overflow in ext2fs_punch() when releasing more than 2**31 blocks
Addresses-Debian-Bug: #1106241
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Fri, 6 Jun 2025 22:52:13 +0000 (18:52 -0400)]
libext2fs: fix ext2fs_link() when the directory has an extent tree depth > 1
Ext2fs_link() was passing the wrong inode number to ext2fs_bmap(); as
a result, when a directory inode was using extents and the extent tree
depth was greater than 1, the extent tree checksum would be
incorrectly calculated resulting in a error that the extent tree block
checksum was incorrect.
Fixes:
53aa6c54224f ("libext2fs: add the EXT2FS_LINK_APPEND flag ...)
Addresses-Debian-Bug: #1106854
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Fri, 6 Jun 2025 13:07:11 +0000 (09:07 -0400)]
libext2fs: fix a extent tree corruption bug in ext2fs_extent_set_bmap()
In the case where we are moving a particular logical block mapping
from a particular extent tree entry, to the immediately precending
entry (when the physical block or uninitialized flag is changing so it
can be coalesced with the precending entry) and the precending entry
is in a different extent tree block, the resulting extent tree can get
corrupted.
Fix this by removing the original logical block mapping before adding
the new logical block mapping. Per the warning in the comments before
ext2fs_extents_fix_parents():
Note a subtlety of this function -- if there happen to be two extents
mapping the same lblk and someone calls fix_parents on the second of
the two extents, the position of the extent handle after the call will
be the second extent if nothing happened, or the first extent if
something did. A caller in this situation must use
ext2fs_extent_goto() after calling this function. Or simply don't map
the same lblk with two extents, ever.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Benno Schulenberg [Sun, 1 Jun 2025 12:36:24 +0000 (14:36 +0200)]
e2freefrag: correct a mistyped symbol name
Fixes:
0c675a67c568 ("debugfs: return after printing the usage message..."(
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Benno Schulenberg [Sun, 1 Jun 2025 12:36:23 +0000 (14:36 +0200)]
mke2fs: fix a misindentation in the man page
Problem existed since commit
3c22bf7e70 from twelve years ago.
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 4 Jun 2025 20:29:49 +0000 (20:29 +0000)]
misc: define XATTR_{CREATE,REMOVE} if necessary
This fixes a FreeBSD portability issue in fuse2fs.
Fixes:
5c7fec6121e6 ("fuse2fs: support XATTR_CREATE/REPLACE in setxattr")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 4 Jun 2025 00:16:30 +0000 (00:16 +0000)]
misc: define alternative errno if OS doesn't provide ENODATA
FreeBSD doesn't define ENODATA, and uses ENOATTR when an extended
attribute is not found. So map ENODATA to ENOATTR to fix a build
failure for platforms that don't define ENODATA.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 3 Jun 2025 23:06:37 +0000 (23:06 +0000)]
debian: add a Built-Using field to the e2fsck-static package
We will probably want to eventually revert this commit and replace it
with a change using dh-builtusing, such as can be found in [1], but
dh-builtusing is only available in Debian 13 (trixie) and we don't
want to make life difficult for people who need to backport to Debian
Stable or Ubuntu LTS.
[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1106799#32
Addresses-Debian-Bug: #1106799
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 3 Jun 2025 17:31:40 +0000 (17:31 +0000)]
debian: remove physical address of the FSF from the copyright file
Use https://www.gnu.org/licenses instead of telling users to request a
copy of the license text via snail (postal) mail.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 28 May 2025 14:50:38 +0000 (10:50 -0400)]
debian: release 1.47.3~rc1-1 to experimental
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 28 May 2025 14:44:08 +0000 (10:44 -0400)]
debian: use 1.47.3~rc1 in libext2fs2t64.symbols instead of 1.47.3
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 28 May 2025 12:33:03 +0000 (08:33 -0400)]
Update release notes, etc., for the 1.47.3 release
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 28 May 2025 12:27:00 +0000 (08:27 -0400)]
po: add Georgian language from the Translation Project
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Мирослав Николић [Wed, 28 May 2025 12:19:37 +0000 (08:19 -0400)]
po: update sr.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Pedro Albuquerque [Wed, 28 May 2025 12:19:37 +0000 (08:19 -0400)]
po: update pt.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Benno Schulenberg [Wed, 28 May 2025 12:19:37 +0000 (08:19 -0400)]
po: update nl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Sharuzzaman Ahmat Raslan [Wed, 28 May 2025 12:19:37 +0000 (08:19 -0400)]
po: update ms.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 28 May 2025 11:52:44 +0000 (07:52 -0400)]
util: avoid potential buffer overruns caused by super-long pathnames
This shouldn't happen in real life, but this clears a few coverity
warning.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 27 May 2025 21:06:58 +0000 (17:06 -0400)]
debian: update libext2fs2t64.symbols with shared library additions
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 27 May 2025 21:05:13 +0000 (17:05 -0400)]
Update Makefile.in files using "make depend"
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 27 May 2025 21:04:24 +0000 (17:04 -0400)]
.gitignore: add files generated by "make depend"
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 27 May 2025 16:49:22 +0000 (12:49 -0400)]
Merge branch 'fix-fuse' of github.com:allisonkarlitskaya/e2fsprogs into next
Theodore Ts'o [Mon, 26 May 2025 20:46:45 +0000 (16:46 -0400)]
create_inode: fix 32-bit -Werror=pointer-to-int-cast build failure
Fixes:
6bfa843b4435 ("mke2fs: enable copying of fs-verity metadata")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 26 May 2025 20:25:15 +0000 (16:25 -0400)]
debugfs: return after printing the usage message in the e2freefrag command
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Allison Karlitskaya [Mon, 26 May 2025 18:38:16 +0000 (20:38 +0200)]
fuse2fs: fix old libfuse compatibility issue
We only have the 'cfg' parameter defined here #if FUSE_VERSION >=
FUSE_MAKE_VERSION(3, 0), so only attempt to access it in that case as
well.
In particular, this fixes an issue when building on the GitHub Actions
runners.
Signed-off-by: Allison Karlitskaya <allison.karlitskaya@redhat.com>
Theodore Ts'o [Mon, 26 May 2025 17:53:25 +0000 (13:53 -0400)]
misc: remove unused retry label
Fixes:
0a5dc78ba4dc ("Add a support for new flag (EXT2FS_LINK_EXPAND) ..."
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 26 May 2025 17:29:19 +0000 (13:29 -0400)]
e2fsck: add error checking for sysconf(3) in get_memory_size()
Also remove some dead code relating to using sysctl().
Addresses-Coverity-Bug: 1633755
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 26 May 2025 16:51:49 +0000 (12:51 -0400)]
mke2fs: add range checks for -E desc_size
Prevent the user from specifying group descriptor that result in
invalid/corrupted file systems.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 26 May 2025 16:36:07 +0000 (12:36 -0400)]
e2freefrag: require that the chunksize must be greater than 0
"e2freefrag -c 0" doesn't make much sense, so abort with an error
message if the user specifies a zero chunksize.
Addresses-Coverity-Bug: 1633767
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 26 May 2025 14:09:59 +0000 (10:09 -0400)]
libe2p: avoid potential integer overflow in interate_on_dir()
Overflows won't happen if the OS's implementation of pathconf()
returns reasonable values, but we can make it a bit more hardened
against maliciou implementations.
Addresses-Coverity-Bug: 1633758
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Super User [Wed, 9 Apr 2025 13:59:58 +0000 (16:59 +0300)]
e4defrag: fix memory leak
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 26 May 2025 02:20:36 +0000 (22:20 -0400)]
e2fsck: fix e2fsck -E unshare_blocks when there are no shared blocks
If there are no shared blocks in a ext4 file system, e2fsck -E
unshare_blocks will not actually clear the shared_blocks feature flag
since e2fsck_pass1_dupblocks() is never called. Fix this by adding a
check in e2fsck_pass1() to clear the shared blocks flag.
https://github.com/tytso/e2fsprogs/issues/218
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 26 May 2025 01:37:38 +0000 (21:37 -0400)]
libext2fs: fix Coverity type warnings from ext2fs_inode_xtime_set()
The ext2fs_inode_xtime_set() C preprocessor macro needs to cast to
__u32 before assigning to the time field.
This fixes a number of integer handling issues reported by Coverity.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sun, 25 May 2025 16:51:36 +0000 (12:51 -0400)]
mke2fs: propagate some chattr flags into the fs image when using mke2fs -d
When copying files from a source directory, propagate chattr flags
such as the immutable, append-only, nodump, etc. into the files in the
destination file system. Flags in directory inodes are also propagated.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sun, 25 May 2025 05:11:54 +0000 (01:11 -0400)]
libext2fs: add new function ext2fs_mkdir2()
Add a new function which allows caller to specify the flags passed to
ext2fs_link and to set flags in the newly created directory.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sun, 25 May 2025 21:38:49 +0000 (17:38 -0400)]
libext2fs: fix ext2fs_link() for EXT2FS_LINK_APPEND and non-regular files
Fix the incorrect flag being passed to ext2fs_process_dir_block().
This bug was masked because EXT2_FT_REG_FILE has the same code point
as DIRENT_FLAG_INCLUDE_EMPTY which was the flag that was needed and
mke2fs -d was only use ext2fs_lik() for regular files.
Fixes:
53aa6c54224f ("libext2fs: add the EXT2FS_LINK_APPEND flag ...)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Sun, 25 May 2025 04:39:13 +0000 (00:39 -0400)]
Add a support for new flag (EXT2FS_LINK_EXPAND) for ext2fs_link()
Many calls to ext2fs_link() checks for EXT2_ET_DIR_NO_SPACE and if so,
calls ext2fs_expand_dir() and then retries the ext2fs_link(). We can
simplify a lot of code by adding support for a flag which does the
retry into the ext2fs_link() function.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Allison Karlitskaya [Thu, 13 Mar 2025 16:18:17 +0000 (17:18 +0100)]
mke2fs: disallow -O verity without extents
Similar to 64-bit support, fs-verity support requires extents, so don't
allow to create a filesystem that has -O verity unless it also supports
extents.
Theodore Ts'o [Sat, 24 May 2025 23:28:13 +0000 (19:28 -0400)]
mke2fs: add support for copying signature blobs in the fs-verity metadata
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Allison Karlitskaya [Mon, 25 Nov 2024 08:46:30 +0000 (09:46 +0100)]
mke2fs: enable copying of fs-verity metadata
When creating a filesystem with `mke2fs -O verity` and populating
content via `-d`, check if that content is fs-verity enabled, and if it
is, copy the fs-verity metadata from the host-native filesystem into the
created filesystem.
Closes: https://github.com/tytso/e2fsprogs/pull/201
Signed-off-by: Allison Karlitskaya <allison.karlitskaya@redhat.com>
Allison Karlitskaya [Mon, 25 Nov 2024 08:46:30 +0000 (09:46 +0100)]
mke2fs: factor out 'write_all()' functionality
When writing data to an inode (with mke2fs -d) we need to do the typical
loop to handle partial writes to make sure all of the data gets written.
Move that code to its own function. This function also takes an offset
parameter, which makes it feel a bit like pwrite() (except that it does
modify the file offset).
Signed-off-by: Allison Karlitskaya <allison.karlitskaya@redhat.com>
Allison Karlitskaya [Mon, 25 Nov 2024 08:46:30 +0000 (09:46 +0100)]
mke2fs: modify the fallback path for copying data
Right now we jump to the end as soon as we've found a method that works.
This is a reasonable approach because it's the last operation in the
function, but soon it won't be. Switch to a logically-equivalent
alternative approach: keep trying until we find the approach that works,
dropping the `goto out`. Now we can add code after this.
Signed-off-by: Allison Karlitskaya <allison.karlitskaya@redhat.com>
Theodore Ts'o [Fri, 23 May 2025 17:22:00 +0000 (13:22 -0400)]
debugfs: abort reading a file on failure when dumping out a file
If ext2fs_file_read() fails --- perhaps due to a corrupted file
system, or an I/O error --- avoid looping forever in dump_file().
This issue was pointed out in [1] by Quentin Kaiser but the commit
description was too confusing and specific to the user's particular
situation.
[1] https://github.com/tytso/e2fsprogs/pull/149
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:43:17 +0000 (15:43 -0700)]
fuse2fs: implement blocksize converters
Before we implement iomap, add some helpers to convert bytes to fsblocks
and back.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786678247.1384866.5139178053250117853.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:43:01 +0000 (15:43 -0700)]
fuse2fs: replace ext2fs_{read,write}_inode with fuse2fs_{read,write}_inode
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786678229.1384866.9795826246954895736.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:42:46 +0000 (15:42 -0700)]
fuse2fs: clean up open-coded ext2_inode_large -> ext2_inode casts
There's a typechecked helper for this now, so let's use it.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786678211.1384866.6557992647185012616.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:42:30 +0000 (15:42 -0700)]
fuse2fs: fix group membership checking in op_chmod
In the decade or so since I touched fuse2fs, libfuse3 has grown the
ability to read the group ids of a process making a chmod request. So
now we actually /can/ determine if a file's gid is a in the group list
of the process that initiated a fuse request. Let's implement that too.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786678066.1383760.15547379523110361909.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:42:14 +0000 (15:42 -0700)]
fuse2fs: propagate default ACLs to new children
generic/319 points out that we don't propagate the default ACL from a
directory into new children. Do that, since that's expected behavior.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786678048.1383760.1562421474540065349.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:41:59 +0000 (15:41 -0700)]
fuse2fs: also ignore the nodelalloc mount option
We don't support delalloc, so accept the nodelalloc option even if we do
nothing about it.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786678032.1383760.18384774850296194367.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:41:43 +0000 (15:41 -0700)]
fuse2fs: fix post-EOF preallocation clearing on truncation
generic/092 shows that truncating a file to its current size does not
clean out post-eof preallocations like the kernel does. Adopt the
kernel's behavior for consistency.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786678014.1383760.1321101978729586160.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:41:26 +0000 (15:41 -0700)]
fuse2fs: fix removing ea inodes when freeing a file
If the filesystem has ea_inode set, then each file that has xattrs might
have stored an xattr value in a separate inode. These inodes also need
to be freed, so create a library function to do that, and call it from
the fuse2fs unlink method. Seen by ext4/026.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786677996.1383760.7408606469648643965.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:43:01 +0000 (15:43 -0700)]
fuse2fs: simplify reading and writing inodes
Wrap the inode read and write methods in a wrapper so that we don't have
to maintain all these silly casts and sizeof operators.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786678229.1384866.9795826246954895736.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:41:11 +0000 (15:41 -0700)]
fuse2fs: fix return value handling
For the xattr functions, don't obliterate the return value of the file
system operation with an error code coming from ext2fs_xattrs_close
failing. Granted, it doesn't ever fail (right now!) so this is mostly
just preening.
Also fix the obsolete op_truncate not to squash error returns.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786677978.1383760.8801097477278077188.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:40:55 +0000 (15:40 -0700)]
fuse2fs: check for supported xattr name prefixes
Ignore any xattr calls for name prefixes that the kernel doesn't also
support.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786677959.1383760.12099114841852662650.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:40:39 +0000 (15:40 -0700)]
fuse2fs: fix fallocate zero range
Allow this flag when we're checking flags in op_fallocate.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786677941.1383760.17359353030156900900.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:40:23 +0000 (15:40 -0700)]
fuse2fs: decode fuse_main error codes
Translate the fuse_main return values into actual mount(8) style error
codes instead of returning 0 all the time, and print something to the
original stderr if something went wrong so that the user will know what
to do next.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786677923.1383760.3429767121128890204.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:40:08 +0000 (15:40 -0700)]
fuse2fs: implement O_APPEND correctly
Try to implement append-only files correctly.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786677905.1383760.14021746902005874478.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:39:52 +0000 (15:39 -0700)]
fuse2fs: check the immutable flag in more places
We need to check the immutable flag in a few more places that try to
modify files.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786677887.1383760.16795876049190712906.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:39:36 +0000 (15:39 -0700)]
fuse2fs: return EPERM for write access to EXT2_IMMUTABLE_FL files
The kernel drivers return EPERM for attempts to write to immutable
files, so switch the error code.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786677869.1383760.310634374176043971.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:39:21 +0000 (15:39 -0700)]
fuse2fs: make bad magic numbers report a corruption error too
Report bad magic numbers as corruption errors too.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786677853.1383760.10493605429423115597.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:39:05 +0000 (15:39 -0700)]
fuse2fs: make internal state corruption a hard error
If the in-memory contents are wrong, then we want to report a corruption
error and shut down the filesystem.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786677837.1383760.2730283507317571357.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:38:49 +0000 (15:38 -0700)]
fuse2fs: make filesystem corruption a hard error
Change __translate_error so that all the EXT2_*_CORRUPTED codes generate
a hard error returning EUCLEAN which is the same errno that the kernel
uses.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786677819.1383760.15120011207188940205.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:38:34 +0000 (15:38 -0700)]
fuse2fs: rearrange check_inum_access parameters a bit
Pass the struct fuse2fs pointer to check_inum_access so that we can do
some more rearranging in the next patches.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786677801.1383760.3807372754743381596.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:38:18 +0000 (15:38 -0700)]
fuse2fs: implement O_TRUNC correctly
Actually truncate files on open with O_TRUNC.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786677783.1383760.5736479713431403960.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:38:02 +0000 (15:38 -0700)]
fuse2fs: make removexattr work correctly
removexattr is supposed to return ENODATA if the xattr name does not
exist, so we need to check for it explicitly.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786677765.1383760.11407998503450588763.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:37:47 +0000 (15:37 -0700)]
fuse2fs: enable processing of acls in the kernel
Let the kernel process ACLs.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786677747.1383760.17294624757826456720.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:37:31 +0000 (15:37 -0700)]
fuse2fs: allow some control over acls
Allow some control over whether or not ACLs get used, though for kernel
mode it will always be enabled.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786677729.1383760.10883670792875770541.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:37:15 +0000 (15:37 -0700)]
fuse2fs: fix CLI argument parsing leaks
Fix some memory leaks in the argument parser.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786677711.1383760.4278826288377195178.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:37:00 +0000 (15:37 -0700)]
fuse2fs: flip parameter order in __translate_error
Flip the parameter order in __translate_error so that it matches
translate_error. I wasted too much time debugging a memory corruption
that happened because I converted translate_error to __translate_error
when developing the next patch and the compiler didn't warn me about
mismatched types.
Cc: linux-ext4@vger.kernel.org # v1.43
Fixes:
81cbf1ef4f5dab ("misc: add fuse2fs, a FUSE server for e2fsprogs")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786677693.1383760.5102016357729108965.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:36:44 +0000 (15:36 -0700)]
fuse2fs: fix error return handling in op_truncate
Fix a couple of bugs with the errcode/ret handling in op_truncate.
First, we need to return ESTALE for a zero inumber because there is no
inode zero in an ext* filesystem. Second, we need to return negative
errno for failures to libfuse, not raw errcode_t.
Cc: linux-ext4@vger.kernel.org # v1.43
Fixes:
81cbf1ef4f5dab ("misc: add fuse2fs, a FUSE server for e2fsprogs")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786677675.1383760.13355151028679279614.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:36:28 +0000 (15:36 -0700)]
fuse2fs: support XATTR_CREATE/REPLACE in setxattr
Fix the setxattr implementation to support the create and replace flags
instead of performing an upsert regardless of inputs.
Cc: linux-ext4@vger.kernel.org # v1.43
Fixes:
81cbf1ef4f5dab ("misc: add fuse2fs, a FUSE server for e2fsprogs")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786677657.1383760.12232239908991346763.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:36:13 +0000 (15:36 -0700)]
fuse2fs: compact all the boolean flags in struct fuse2fs
Compact all the booleans into u8 fields. I'd go further and turn them
into bitfields but that breaks the fuse argument parsing macros, which
compute the offset of the structure fields, and gcc won't let us do that
to bit fields. Still, 136 -> 112 bytes isn't bad.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786677639.1383760.16546264802006958473.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:35:57 +0000 (15:35 -0700)]
fuse2fs: fix cache size parsing
Fix the cache size parsing of "cache_size=%s" -- the "%" is at position
11, not 12.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786677621.1383760.4131011398253369305.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:35:41 +0000 (15:35 -0700)]
fuse2fs: clean up error messages
Instead of horridly line-wrapping multi-line messages that are printed
during mounting, let's just expand them to be one source code line per
printed line. This will make it a lot easier for someone who sees the
these errors to grep the source code to find out where they came from.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786677603.1383760.817536477752866097.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:35:26 +0000 (15:35 -0700)]
libext2fs: fix livelock in the unix io manager
generic/441 found a livelock in the unix IO manager. Let's say that
write_primary_superblock decides to call io_channel_set_blksize in the
process of writing the primary super.
unix_set_blksize then takes the cache and bounce mutexes, and calls
flush_cached_blocks. If there are dirty blocks in the cache, they will
be written with raw_write_blk. Unfortunately, that function tries to
take the bounce mutex, which we already hold. At that point, we
livelock fuse2fs.
Cc: linux-ext4@vger.kernel.org # v1.46.0
Fixes:
f20627cc639ab6 ("libext2fs: add threading support to the I/O manager abstraction")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786677584.1383760.1107858755678329558.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Darrick J. Wong [Wed, 21 May 2025 22:35:10 +0000 (15:35 -0700)]
libext2fs: fix unix io manager invalidation
flush_cached_blocks does not invalidate clean blocks from the block
cache. From reading all the call sites, it looks like they all actually
want the cache to be empty on successful return, so adjust the
implementation to do this.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174786677566.1383760.15330012260577982100.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Fri, 23 May 2025 03:53:40 +0000 (23:53 -0400)]
fuse2fs: fix portability issues when compiling on MacOS
Fix a number of portability issues which resulted in fuse2fs failing
to build on MacOS.
*) MacOS doesn't have the timespec fields in struct stat; we have
a autoconf test to check for this, so use it.
*) The portable way to print off_t values is to use
printf("%jd", (intmax_t) d); The cast is necessary to avoid
type mismatch warnings.
*) Define FUSE_DARWIN_ENABLE_EXTENSIONS=0 to avoid using random
structs such as struct fuse_darwin_attr and struct fuse_darwin_fill_dir_t
in the fuse operation function prototypes.
With these fixes, fuse2fs successfully compiles and works with
MacFuse on macOS Sequoia.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Thu, 22 May 2025 05:24:52 +0000 (01:24 -0400)]
e2fsck: fix int vs ssize_t warnings from Coverity
Addresses-Coverity-Bug: 1605231
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Thu, 22 May 2025 04:53:02 +0000 (00:53 -0400)]
util: fix potential OOB write in the symlinks build helper
Addresses-Coverity-Bug: 1432089
Addresses-Coverity-Bug: 1433050
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Thu, 22 May 2025 00:16:08 +0000 (20:16 -0400)]
libext2fs: fix error paths after alocation failures
Addresses-Coverity-Bug: 1647960
Addresses-Coverity-Bug: 1647961
Fixes:
a5a6bcfb4820 ("libext2fs: make unix_io cache size configurable")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 21 May 2025 17:44:24 +0000 (13:44 -0400)]
Fix signed/unsigned compiler warnings
Fixes:
a5a6bcfb4820 ("libext2fs: make unix_io cache size configurable")
Fixes:
516805378ff5 ("fuse2fs: allow setting of the cache size")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 21 May 2025 17:41:11 +0000 (13:41 -0400)]
misc: link filefrag with the ext2fs library
If inline functions are not enabled, filefrag needs to link with
libext2fs to be able to access the ext2fs_log_u32() function.
Fixes:
be4834c29e6f ("misc: deduplicate log2/log10 functions")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Wed, 21 May 2025 16:33:15 +0000 (12:33 -0400)]
libext2fs: add missing function prototypes for new inline functions
Fixes:
be4834c29e6f ("misc: deduplicate log2/log10 functions")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>