Linux EXT4 FS development
 help / color / mirror / Atom feed
* Re: [GIT PULL v5.1] libfuse: run fuse servers as a contained service
From: Bernd Schubert @ 2026-05-02 16:58 UTC (permalink / raw)
  To: Darrick J. Wong
  Cc: fuse-devel, joannelkoong, linux-ext4, linux-fsdevel, miklos, neal
In-Reply-To: <20260502163027.GO7765@frogsfrogsfrogs>



On 5/2/26 18:30, Darrick J. Wong wrote:
> On Sat, May 02, 2026 at 05:59:06PM +0200, Bernd Schubert wrote:
>>
>>
>> On 5/1/26 00:49, Darrick J. Wong wrote:
>>> On Thu, Apr 30, 2026 at 11:34:06PM +0200, Bernd Schubert wrote:
>>>> Hi Darrick,
>>>>
>>>> On 4/30/26 23:18, Darrick J. Wong wrote:
>>>>> Hi Bernd,
>>>>>
>>>>> Please pull this branch with changes for libfuse.
>>>>>
>>>>> As usual, I did a test-merge with the main upstream branch as of a few
>>>>> minutes ago, and didn't see any conflicts.  Please let me know if you
>>>>> encounter any problems.
>>>>
>>>> pushed to my github branch. BSD build fails with
>>>>
>>>> 2026-04-30T21:25:16.3874802Z FAILED: [code=1] lib/libfuse3.so.3.19.0 
>>>> 2026-04-30T21:25:16.3906762Z cc  -o lib/libfuse3.so.3.19.0 lib/libfuse3.so.3.19.0.p/fuse.c.o lib/libfuse3.so.3.19.0.p/fuse_loop.c.o lib/libfuse3.so.3.19.0.p/fuse_loop_mt.c.o lib/libfuse3.so.3.19.0.p/fuse_lowlevel.c.o lib/libfuse3.so.3.19.0.p/fuse_opt.c.o lib/libfuse3.so.3.19.0.p/fuse_signals.c.o lib/libfuse3.so.3.19.0.p/buffer.c.o lib/libfuse3.so.3.19.0.p/cuse_lowlevel.c.o lib/libfuse3.so.3.19.0.p/helper.c.o lib/libfuse3.so.3.19.0.p/modules_subdir.c.o lib/libfuse3.so.3.19.0.p/mount_util.c.o lib/libfuse3.so.3.19.0.p/fuse_log.c.o lib/libfuse3.so.3.19.0.p/compat.c.o lib/libfuse3.so.3.19.0.p/util.c.o lib/libfuse3.so.3.19.0.p/mount_bsd.c.o lib/libfuse3.so.3.19.0.p/fuse_service_stub.c.o lib/libfuse3.so.3.19.0.p/modules_iconv.c.o -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,-soname,libfuse3.so.4 -Wl,--version-script,/home/runner/work/libfuse/libfuse/lib/fuse_versionscript -pthread -Wl,--start-group -ldl -lrt -Wl,--end-group
>>>> 2026-04-30T21:25:16.3939590Z ld: error: version script assignment of 'FUSE_3.19' to symbol 'fuse_service_can_allow_other' failed: symbol not defined
>>>
>>> Aha, that function got left out of the stub. :(
>>>
>>> Annoyingly, on Linux the build succeeds despite the missing symbol
>>> when I tweak meson so that it doesn't build the service stuff.  I would
>>> have thought that --no-undefined would have done that, but alas.
>>>
>>> Sorry about that too.  The following patch fixes it.
>>>
>>> diff --git i/lib/fuse_service_stub.c w/lib/fuse_service_stub.c
>>> index d34df3891a6e31..231b98423df628 100644
>>> --- i/lib/fuse_service_stub.c
>>> +++ w/lib/fuse_service_stub.c
>>> @@ -49,12 +49,17 @@ int fuse_service_send_goodbye(struct fuse_service *sf, int error)
>>>  int fuse_service_accept(struct fuse_service **sfp)
>>>  {
>>>  	*sfp = NULL;
>>>  	return 0;
>>>  }
>>>  
>>> +bool fuse_service_can_allow_other(struct fuse_service *sf)
>>> +{
>>> +	return false;
>>> +}
>>> +
>>>  int fuse_service_append_args(struct fuse_service *sf,
>>>  			     struct fuse_args *existing_args)
>>>  {
>>>  	return -EOPNOTSUPP;
>>>  }
>>>  
>>>
>>>> 2026-04-30T21:25:16.3951874Z cc: error: linker command failed with exit code 1 (use -v to see invocation)
>>>> 2026-04-30T21:25:16.4291582Z [44/82] cc -Itest/test_teardown_watchdog.p -Itest -I../test -Iinclude -I../include -Ilib -I../lib -I. -I.. -fdiagnostics-color=always -
>>>>
>>>>
>>>> checkpatch, CodeChecker-cppcheck, CodeChecker-gcc also all fail. This CodeQL
>>>
>>> Not sure why checkpatch fails, this is what I got (Debian 13):
>>>
>>> $ git diff origin/master.. | ./checkpatch.pl --max-line-length=100 --no-tree --ignore MAINTAINERS,SPDX_LICENSE_TAG,COMMIT_MESSAGE,FILE_PATH_CHANGES,EMAIL_SUBJECT,AVOID_EXTERNS,GIT_COMMIT_ID,ENOSYS_SYSCALL,ENOSYS,FROM_SIGN_OFF_MISMATCH,QUOTED_COMMIT_ID,,PREFER_ATTRIBUTE_ALWAYS_UNUSED,PREFER_DEFINED_ATTRIBUTE_MACRO,STRCPY,STRNCPY -
>>> No typos will be found - file '/storage/home/djwong/cdev/work/libfuse/spelling.txt': No such file or directory
>>> No structs that should be const will be found - file '/storage/home/djwong/cdev/work/libfuse/const_structs.checkpatch': No such file or directory
>>> total: 0 errors, 0 warnings, 3908 lines checked
>>>
>>> Your patch has no obvious style problems and is ready for submission.
>>>
>>> NOTE: Ignored message types: AVOID_EXTERNS COMMIT_MESSAGE EMAIL_SUBJECT ENOSYS ENOSYS_SYSCALL FILE_PATH_CHANGES FROM_SIGN_OFF_MISMATCH GIT_COMMIT_ID MAINTAINERS PREFER_ATTRIBUTE_ALWAYS_UNUSED PREFER_DEFINED_ATTRIBUTE_MACRO QUOTED_COMMIT_ID SPDX_LICENSE_TAG STRCPY STRNCPY
>>>
>>> cppcheck had a few things to say, but none of it was about the changed
>>> lines.
>>>
>>>> report is funny
>>>>
>>>>> int mount_service_main(int argc, char *argv[])
>>>>> Warning
>>>>> Poorly documented large function
>>>>> Poorly documented function: fewer than 2% comments for a function of 113 lines.
>>>>> CodeQL
>>>
>>> Hrmm.  I guess I'll have to figure out how to get those things running.
>>> That said, the stuff in mount_service.c is internal to libfuse (i.e.
>>> it's not public library API) so I didn't comment them as intensely.
>>> Would you like more?
>>>
>>>> I think I'm going to merge my sync fuse init series tomorrow.
>>>
>>> Yay!
>>>
>>>> Are you ok if skip posting another version of the series?
>>>
>>>                ^ is there an "I" here?  e.g. "...if I skip posting..."?
>>>
>>> /My/ normal practice (from xfs) was to repost the series as it was
>>> merged, followed by an announcement.  That way the mailing list is a
>>> complete record of what was merged.  However, very very few people
>>> actually do that, even in the kernel.
>>>
>>> I'm ok with you not posting another version of the series.
>>>
>>>> Or do you prefer to review the recent changes and last piece I'm going
>>>> to do tomorrow?
>>>
>>> Nah, just merge it.  I'll look over the changes once it's in the branch
>>> and if there's anything weird, you or I or anyone else can send patches.
>>> As long as you're not planning to tag it as a release, nothing's set in
>>> stone.
>>>
>>>> Basically my goal is to rebase your series against it immediately and
>>>> to merge your series during the next few days.
>>>
>>> <nod> Let me know what you want changed, I'll be around since I am not
>>> travelling anywhere for a couple of weeks. :)
>>>
>>> I can reflow changes into the patchset, or if you'd prefer, I can add
>>> them as new patches that would go on the end of the series.
>>>
>>
>> Hi Darrick,
>>
>> eventually merged my patches and made a quick rebase and conflict 
>> resolving with your branch. Github still reports plenty of issues ;)
>>
>> Could you fix all of the checkpatch isssues? This one shows plenty
>> "util: hoist the fuse.conf parsing and setuid mode enforcement code"
>>
>> bschubert2@imesrv6 libfuse.git>stg series
>> + mount_service-add-systemd
>> + mount_service-create-high
>> + mount_service-use-the-new
>> + mount_service-update-mtab
>>> util-hoist-the-fuse.conf
>> - util-fix-checkpatch-complaints
>> - mount_service-enable
>> - mount.fuse3-integrate-systemd
>> - mount_service-allow
>> - example-service_ll-create-a
>> - example-service-create-a
>> - nullfs-support-fuse-systemd
>> - meson-show-feature-summary
>> bschubert2@imesrv6 libfuse.git>.github/workflows/run-checkpatch.sh 
>> No typos will be found - file '/home/bschubert2/src/libfuse/libfuse.git/spelling.txt': No such file or directory
>> No structs that should be const will be found - file '/home/bschubert2/src/libfuse/libfuse.git/const_structs.checkpatch': No such file or directory
>> ERROR:GLOBAL_INITIALISERS: do not initialise globals to 0
>> #61: FILE: util/fuser_conf.c:33:
>> +int user_allow_other = 0;
>>
>> WARNING:LINE_SPACING: Missing a blank line after declarations
>> #74: FILE: util/fuser_conf.c:46:
>> +	char *dest = buf;
>> +	while (1) {
> 
> Oh!  The checkpatch fixes are all in the next commit
> "util-fix-checkpatch-complaints".  I kept the checkpatch fixes as a
> separate commit so that the hoist change can be inspected more easily.

That is not going to work, the script it set up to check every commit in
the PR branch.

> 
> (XFS practice is to have separate patches for moving the code and
> cleaning it up)
> 
>> ...
>>
>> I don't have a strong opinion about these two above - feel 
>> free to disable them. However, in order to merge it, it would
>> be good to run without any checkpatch report.
>> And everything that cppcheck and gcc-checker reports, definitely 
>> need to be fixed.
> 
> Hrm, should I try to fix the things that cppcheck complains about in
> HEAD?  There's an awful lot of them...
> 
> (oh, I see you pushed to master, I'll go rebase now)

I had already rebased:

https://github.com/bsbernd/libfuse/tree/fuse-service-container





^ permalink raw reply

* Re: [GIT PULL v5.1] libfuse: run fuse servers as a contained service
From: Darrick J. Wong @ 2026-05-02 18:57 UTC (permalink / raw)
  To: Bernd Schubert
  Cc: fuse-devel, joannelkoong, linux-ext4, linux-fsdevel, miklos, neal
In-Reply-To: <c88d39e4-0a67-4de6-9d7d-353f8c950c81@bsbernd.com>

On Sat, May 02, 2026 at 06:58:30PM +0200, Bernd Schubert wrote:
> 
> 
> On 5/2/26 18:30, Darrick J. Wong wrote:
> > On Sat, May 02, 2026 at 05:59:06PM +0200, Bernd Schubert wrote:
> >>
> >>
> >> On 5/1/26 00:49, Darrick J. Wong wrote:
> >>> On Thu, Apr 30, 2026 at 11:34:06PM +0200, Bernd Schubert wrote:
> >>>> Hi Darrick,
> >>>>
> >>>> On 4/30/26 23:18, Darrick J. Wong wrote:
> >>>>> Hi Bernd,
> >>>>>
> >>>>> Please pull this branch with changes for libfuse.
> >>>>>
> >>>>> As usual, I did a test-merge with the main upstream branch as of a few
> >>>>> minutes ago, and didn't see any conflicts.  Please let me know if you
> >>>>> encounter any problems.
> >>>>
> >>>> pushed to my github branch. BSD build fails with
> >>>>
> >>>> 2026-04-30T21:25:16.3874802Z FAILED: [code=1] lib/libfuse3.so.3.19.0 
> >>>> 2026-04-30T21:25:16.3906762Z cc  -o lib/libfuse3.so.3.19.0 lib/libfuse3.so.3.19.0.p/fuse.c.o lib/libfuse3.so.3.19.0.p/fuse_loop.c.o lib/libfuse3.so.3.19.0.p/fuse_loop_mt.c.o lib/libfuse3.so.3.19.0.p/fuse_lowlevel.c.o lib/libfuse3.so.3.19.0.p/fuse_opt.c.o lib/libfuse3.so.3.19.0.p/fuse_signals.c.o lib/libfuse3.so.3.19.0.p/buffer.c.o lib/libfuse3.so.3.19.0.p/cuse_lowlevel.c.o lib/libfuse3.so.3.19.0.p/helper.c.o lib/libfuse3.so.3.19.0.p/modules_subdir.c.o lib/libfuse3.so.3.19.0.p/mount_util.c.o lib/libfuse3.so.3.19.0.p/fuse_log.c.o lib/libfuse3.so.3.19.0.p/compat.c.o lib/libfuse3.so.3.19.0.p/util.c.o lib/libfuse3.so.3.19.0.p/mount_bsd.c.o lib/libfuse3.so.3.19.0.p/fuse_service_stub.c.o lib/libfuse3.so.3.19.0.p/modules_iconv.c.o -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,-soname,libfuse3.so.4 -Wl,--version-script,/home/runner/work/libfuse/libfuse/lib/fuse_versionscript -pthread -Wl,--start-group -ldl -lrt -Wl,--end-group
> >>>> 2026-04-30T21:25:16.3939590Z ld: error: version script assignment of 'FUSE_3.19' to symbol 'fuse_service_can_allow_other' failed: symbol not defined
> >>>
> >>> Aha, that function got left out of the stub. :(
> >>>
> >>> Annoyingly, on Linux the build succeeds despite the missing symbol
> >>> when I tweak meson so that it doesn't build the service stuff.  I would
> >>> have thought that --no-undefined would have done that, but alas.
> >>>
> >>> Sorry about that too.  The following patch fixes it.
> >>>
> >>> diff --git i/lib/fuse_service_stub.c w/lib/fuse_service_stub.c
> >>> index d34df3891a6e31..231b98423df628 100644
> >>> --- i/lib/fuse_service_stub.c
> >>> +++ w/lib/fuse_service_stub.c
> >>> @@ -49,12 +49,17 @@ int fuse_service_send_goodbye(struct fuse_service *sf, int error)
> >>>  int fuse_service_accept(struct fuse_service **sfp)
> >>>  {
> >>>  	*sfp = NULL;
> >>>  	return 0;
> >>>  }
> >>>  
> >>> +bool fuse_service_can_allow_other(struct fuse_service *sf)
> >>> +{
> >>> +	return false;
> >>> +}
> >>> +
> >>>  int fuse_service_append_args(struct fuse_service *sf,
> >>>  			     struct fuse_args *existing_args)
> >>>  {
> >>>  	return -EOPNOTSUPP;
> >>>  }
> >>>  
> >>>
> >>>> 2026-04-30T21:25:16.3951874Z cc: error: linker command failed with exit code 1 (use -v to see invocation)
> >>>> 2026-04-30T21:25:16.4291582Z [44/82] cc -Itest/test_teardown_watchdog.p -Itest -I../test -Iinclude -I../include -Ilib -I../lib -I. -I.. -fdiagnostics-color=always -
> >>>>
> >>>>
> >>>> checkpatch, CodeChecker-cppcheck, CodeChecker-gcc also all fail. This CodeQL
> >>>
> >>> Not sure why checkpatch fails, this is what I got (Debian 13):
> >>>
> >>> $ git diff origin/master.. | ./checkpatch.pl --max-line-length=100 --no-tree --ignore MAINTAINERS,SPDX_LICENSE_TAG,COMMIT_MESSAGE,FILE_PATH_CHANGES,EMAIL_SUBJECT,AVOID_EXTERNS,GIT_COMMIT_ID,ENOSYS_SYSCALL,ENOSYS,FROM_SIGN_OFF_MISMATCH,QUOTED_COMMIT_ID,,PREFER_ATTRIBUTE_ALWAYS_UNUSED,PREFER_DEFINED_ATTRIBUTE_MACRO,STRCPY,STRNCPY -
> >>> No typos will be found - file '/storage/home/djwong/cdev/work/libfuse/spelling.txt': No such file or directory
> >>> No structs that should be const will be found - file '/storage/home/djwong/cdev/work/libfuse/const_structs.checkpatch': No such file or directory
> >>> total: 0 errors, 0 warnings, 3908 lines checked
> >>>
> >>> Your patch has no obvious style problems and is ready for submission.
> >>>
> >>> NOTE: Ignored message types: AVOID_EXTERNS COMMIT_MESSAGE EMAIL_SUBJECT ENOSYS ENOSYS_SYSCALL FILE_PATH_CHANGES FROM_SIGN_OFF_MISMATCH GIT_COMMIT_ID MAINTAINERS PREFER_ATTRIBUTE_ALWAYS_UNUSED PREFER_DEFINED_ATTRIBUTE_MACRO QUOTED_COMMIT_ID SPDX_LICENSE_TAG STRCPY STRNCPY
> >>>
> >>> cppcheck had a few things to say, but none of it was about the changed
> >>> lines.
> >>>
> >>>> report is funny
> >>>>
> >>>>> int mount_service_main(int argc, char *argv[])
> >>>>> Warning
> >>>>> Poorly documented large function
> >>>>> Poorly documented function: fewer than 2% comments for a function of 113 lines.
> >>>>> CodeQL
> >>>
> >>> Hrmm.  I guess I'll have to figure out how to get those things running.
> >>> That said, the stuff in mount_service.c is internal to libfuse (i.e.
> >>> it's not public library API) so I didn't comment them as intensely.
> >>> Would you like more?
> >>>
> >>>> I think I'm going to merge my sync fuse init series tomorrow.
> >>>
> >>> Yay!
> >>>
> >>>> Are you ok if skip posting another version of the series?
> >>>
> >>>                ^ is there an "I" here?  e.g. "...if I skip posting..."?
> >>>
> >>> /My/ normal practice (from xfs) was to repost the series as it was
> >>> merged, followed by an announcement.  That way the mailing list is a
> >>> complete record of what was merged.  However, very very few people
> >>> actually do that, even in the kernel.
> >>>
> >>> I'm ok with you not posting another version of the series.
> >>>
> >>>> Or do you prefer to review the recent changes and last piece I'm going
> >>>> to do tomorrow?
> >>>
> >>> Nah, just merge it.  I'll look over the changes once it's in the branch
> >>> and if there's anything weird, you or I or anyone else can send patches.
> >>> As long as you're not planning to tag it as a release, nothing's set in
> >>> stone.
> >>>
> >>>> Basically my goal is to rebase your series against it immediately and
> >>>> to merge your series during the next few days.
> >>>
> >>> <nod> Let me know what you want changed, I'll be around since I am not
> >>> travelling anywhere for a couple of weeks. :)
> >>>
> >>> I can reflow changes into the patchset, or if you'd prefer, I can add
> >>> them as new patches that would go on the end of the series.
> >>>
> >>
> >> Hi Darrick,
> >>
> >> eventually merged my patches and made a quick rebase and conflict 
> >> resolving with your branch. Github still reports plenty of issues ;)
> >>
> >> Could you fix all of the checkpatch isssues? This one shows plenty
> >> "util: hoist the fuse.conf parsing and setuid mode enforcement code"
> >>
> >> bschubert2@imesrv6 libfuse.git>stg series
> >> + mount_service-add-systemd
> >> + mount_service-create-high
> >> + mount_service-use-the-new
> >> + mount_service-update-mtab
> >>> util-hoist-the-fuse.conf
> >> - util-fix-checkpatch-complaints
> >> - mount_service-enable
> >> - mount.fuse3-integrate-systemd
> >> - mount_service-allow
> >> - example-service_ll-create-a
> >> - example-service-create-a
> >> - nullfs-support-fuse-systemd
> >> - meson-show-feature-summary
> >> bschubert2@imesrv6 libfuse.git>.github/workflows/run-checkpatch.sh 
> >> No typos will be found - file '/home/bschubert2/src/libfuse/libfuse.git/spelling.txt': No such file or directory
> >> No structs that should be const will be found - file '/home/bschubert2/src/libfuse/libfuse.git/const_structs.checkpatch': No such file or directory
> >> ERROR:GLOBAL_INITIALISERS: do not initialise globals to 0
> >> #61: FILE: util/fuser_conf.c:33:
> >> +int user_allow_other = 0;
> >>
> >> WARNING:LINE_SPACING: Missing a blank line after declarations
> >> #74: FILE: util/fuser_conf.c:46:
> >> +	char *dest = buf;
> >> +	while (1) {
> > 
> > Oh!  The checkpatch fixes are all in the next commit
> > "util-fix-checkpatch-complaints".  I kept the checkpatch fixes as a
> > separate commit so that the hoist change can be inspected more easily.
> 
> That is not going to work, the script it set up to check every commit in
> the PR branch.

In that case, please just squash them together with:

$ stg squash -n util-hoist-the-fuse.conf util-hoist-the-fuse.conf util-fix-checkpatch-complaints

> > 
> > (XFS practice is to have separate patches for moving the code and
> > cleaning it up)
> > 
> >> ...
> >>
> >> I don't have a strong opinion about these two above - feel 
> >> free to disable them. However, in order to merge it, it would
> >> be good to run without any checkpatch report.
> >> And everything that cppcheck and gcc-checker reports, definitely 
> >> need to be fixed.
> > 
> > Hrm, should I try to fix the things that cppcheck complains about in
> > HEAD?  There's an awful lot of them...
> > 
> > (oh, I see you pushed to master, I'll go rebase now)
> 
> I had already rebased:
> 
> https://github.com/bsbernd/libfuse/tree/fuse-service-container

Oh!  Ok, I'll rebase against that, then.

--D

^ permalink raw reply

* Re: [GIT PULL v5.1] libfuse: run fuse servers as a contained service
From: Darrick J. Wong @ 2026-05-02 19:05 UTC (permalink / raw)
  To: Bernd Schubert
  Cc: fuse-devel, joannelkoong, linux-ext4, linux-fsdevel, miklos, neal
In-Reply-To: <1d2c00d0-255f-44cd-9757-d7418373cdcd@bsbernd.com>

On Sat, May 02, 2026 at 06:26:16PM +0200, Bernd Schubert wrote:
> 
> 
> On 5/2/26 17:59, Bernd Schubert wrote:
> > 
> > 
> > On 5/1/26 00:49, Darrick J. Wong wrote:
> >> On Thu, Apr 30, 2026 at 11:34:06PM +0200, Bernd Schubert wrote:
> >>> Hi Darrick,
> >>>
> >>> On 4/30/26 23:18, Darrick J. Wong wrote:
> >>>> Hi Bernd,
> >>>>
> >>>> Please pull this branch with changes for libfuse.
> >>>>
> >>>> As usual, I did a test-merge with the main upstream branch as of a few
> >>>> minutes ago, and didn't see any conflicts.  Please let me know if you
> >>>> encounter any problems.
> >>>
> >>> pushed to my github branch. BSD build fails with
> >>>
> >>> 2026-04-30T21:25:16.3874802Z FAILED: [code=1] lib/libfuse3.so.3.19.0 
> >>> 2026-04-30T21:25:16.3906762Z cc  -o lib/libfuse3.so.3.19.0 lib/libfuse3.so.3.19.0.p/fuse.c.o lib/libfuse3.so.3.19.0.p/fuse_loop.c.o lib/libfuse3.so.3.19.0.p/fuse_loop_mt.c.o lib/libfuse3.so.3.19.0.p/fuse_lowlevel.c.o lib/libfuse3.so.3.19.0.p/fuse_opt.c.o lib/libfuse3.so.3.19.0.p/fuse_signals.c.o lib/libfuse3.so.3.19.0.p/buffer.c.o lib/libfuse3.so.3.19.0.p/cuse_lowlevel.c.o lib/libfuse3.so.3.19.0.p/helper.c.o lib/libfuse3.so.3.19.0.p/modules_subdir.c.o lib/libfuse3.so.3.19.0.p/mount_util.c.o lib/libfuse3.so.3.19.0.p/fuse_log.c.o lib/libfuse3.so.3.19.0.p/compat.c.o lib/libfuse3.so.3.19.0.p/util.c.o lib/libfuse3.so.3.19.0.p/mount_bsd.c.o lib/libfuse3.so.3.19.0.p/fuse_service_stub.c.o lib/libfuse3.so.3.19.0.p/modules_iconv.c.o -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,-soname,libfuse3.so.4 -Wl,--version-script,/home/runner/work/libfuse/libfuse/lib/fuse_versionscript -pthread -Wl,--start-group -ldl -lrt -Wl,--end-group
> >>> 2026-04-30T21:25:16.3939590Z ld: error: version script assignment of 'FUSE_3.19' to symbol 'fuse_service_can_allow_other' failed: symbol not defined
> >>
> >> Aha, that function got left out of the stub. :(
> >>
> >> Annoyingly, on Linux the build succeeds despite the missing symbol
> >> when I tweak meson so that it doesn't build the service stuff.  I would
> >> have thought that --no-undefined would have done that, but alas.
> >>
> >> Sorry about that too.  The following patch fixes it.
> >>
> >> diff --git i/lib/fuse_service_stub.c w/lib/fuse_service_stub.c
> >> index d34df3891a6e31..231b98423df628 100644
> >> --- i/lib/fuse_service_stub.c
> >> +++ w/lib/fuse_service_stub.c
> >> @@ -49,12 +49,17 @@ int fuse_service_send_goodbye(struct fuse_service *sf, int error)
> >>  int fuse_service_accept(struct fuse_service **sfp)
> >>  {
> >>  	*sfp = NULL;
> >>  	return 0;
> >>  }
> >>  
> >> +bool fuse_service_can_allow_other(struct fuse_service *sf)
> >> +{
> >> +	return false;
> >> +}
> >> +
> >>  int fuse_service_append_args(struct fuse_service *sf,
> >>  			     struct fuse_args *existing_args)
> >>  {
> >>  	return -EOPNOTSUPP;
> >>  }
> >>  
> >>
> >>> 2026-04-30T21:25:16.3951874Z cc: error: linker command failed with exit code 1 (use -v to see invocation)
> >>> 2026-04-30T21:25:16.4291582Z [44/82] cc -Itest/test_teardown_watchdog.p -Itest -I../test -Iinclude -I../include -Ilib -I../lib -I. -I.. -fdiagnostics-color=always -
> >>>
> >>>
> >>> checkpatch, CodeChecker-cppcheck, CodeChecker-gcc also all fail. This CodeQL
> >>
> >> Not sure why checkpatch fails, this is what I got (Debian 13):
> >>
> >> $ git diff origin/master.. | ./checkpatch.pl --max-line-length=100 --no-tree --ignore MAINTAINERS,SPDX_LICENSE_TAG,COMMIT_MESSAGE,FILE_PATH_CHANGES,EMAIL_SUBJECT,AVOID_EXTERNS,GIT_COMMIT_ID,ENOSYS_SYSCALL,ENOSYS,FROM_SIGN_OFF_MISMATCH,QUOTED_COMMIT_ID,,PREFER_ATTRIBUTE_ALWAYS_UNUSED,PREFER_DEFINED_ATTRIBUTE_MACRO,STRCPY,STRNCPY -
> >> No typos will be found - file '/storage/home/djwong/cdev/work/libfuse/spelling.txt': No such file or directory
> >> No structs that should be const will be found - file '/storage/home/djwong/cdev/work/libfuse/const_structs.checkpatch': No such file or directory
> >> total: 0 errors, 0 warnings, 3908 lines checked
> >>
> >> Your patch has no obvious style problems and is ready for submission.
> >>
> >> NOTE: Ignored message types: AVOID_EXTERNS COMMIT_MESSAGE EMAIL_SUBJECT ENOSYS ENOSYS_SYSCALL FILE_PATH_CHANGES FROM_SIGN_OFF_MISMATCH GIT_COMMIT_ID MAINTAINERS PREFER_ATTRIBUTE_ALWAYS_UNUSED PREFER_DEFINED_ATTRIBUTE_MACRO QUOTED_COMMIT_ID SPDX_LICENSE_TAG STRCPY STRNCPY
> >>
> >> cppcheck had a few things to say, but none of it was about the changed
> >> lines.
> >>
> >>> report is funny
> >>>
> >>>> int mount_service_main(int argc, char *argv[])
> >>>> Warning
> >>>> Poorly documented large function
> >>>> Poorly documented function: fewer than 2% comments for a function of 113 lines.
> >>>> CodeQL
> >>
> >> Hrmm.  I guess I'll have to figure out how to get those things running.
> >> That said, the stuff in mount_service.c is internal to libfuse (i.e.
> >> it's not public library API) so I didn't comment them as intensely.
> >> Would you like more?
> >>
> >>> I think I'm going to merge my sync fuse init series tomorrow.
> >>
> >> Yay!
> >>
> >>> Are you ok if skip posting another version of the series?
> >>
> >>                ^ is there an "I" here?  e.g. "...if I skip posting..."?
> >>
> >> /My/ normal practice (from xfs) was to repost the series as it was
> >> merged, followed by an announcement.  That way the mailing list is a
> >> complete record of what was merged.  However, very very few people
> >> actually do that, even in the kernel.
> >>
> >> I'm ok with you not posting another version of the series.
> >>
> >>> Or do you prefer to review the recent changes and last piece I'm going
> >>> to do tomorrow?
> >>
> >> Nah, just merge it.  I'll look over the changes once it's in the branch
> >> and if there's anything weird, you or I or anyone else can send patches.
> >> As long as you're not planning to tag it as a release, nothing's set in
> >> stone.
> >>
> >>> Basically my goal is to rebase your series against it immediately and
> >>> to merge your series during the next few days.
> >>
> >> <nod> Let me know what you want changed, I'll be around since I am not
> >> travelling anywhere for a couple of weeks. :)
> >>
> >> I can reflow changes into the patchset, or if you'd prefer, I can add
> >> them as new patches that would go on the end of the series.
> >>
> > 
> > Hi Darrick,
> > 
> > eventually merged my patches and made a quick rebase and conflict 
> > resolving with your branch. Github still reports plenty of issues ;)
> > 
> > Could you fix all of the checkpatch isssues? This one shows plenty
> > "util: hoist the fuse.conf parsing and setuid mode enforcement code"
> > 
> > bschubert2@imesrv6 libfuse.git>stg series
> > + mount_service-add-systemd
> > + mount_service-create-high
> > + mount_service-use-the-new
> > + mount_service-update-mtab
> >> util-hoist-the-fuse.conf
> > - util-fix-checkpatch-complaints
> > - mount_service-enable
> > - mount.fuse3-integrate-systemd
> > - mount_service-allow
> > - example-service_ll-create-a
> > - example-service-create-a
> > - nullfs-support-fuse-systemd
> > - meson-show-feature-summary
> > bschubert2@imesrv6 libfuse.git>.github/workflows/run-checkpatch.sh 
> > No typos will be found - file '/home/bschubert2/src/libfuse/libfuse.git/spelling.txt': No such file or directory
> > No structs that should be const will be found - file '/home/bschubert2/src/libfuse/libfuse.git/const_structs.checkpatch': No such file or directory
> > ERROR:GLOBAL_INITIALISERS: do not initialise globals to 0
> > #61: FILE: util/fuser_conf.c:33:
> > +int user_allow_other = 0;
> > 
> > WARNING:LINE_SPACING: Missing a blank line after declarations
> > #74: FILE: util/fuser_conf.c:46:
> > +	char *dest = buf;
> > +	while (1) {
> > 
> > ...
> > 
> > I don't have a strong opinion about these two above - feel 
> > free to disable them. However, in order to merge it, it would
> > be good to run without any checkpatch report.
> > And everything that cppcheck and gcc-checker reports, definitely 
> > need to be fixed.
> 
> Basically
> 
> cd <$FUSEDIR>
> BUILDDIR="build-without-examples"
> mkdir -p ${BUILDDIR}
> meson setup ${BUILDDIR} -Dexamples=false 
> ninja -C ${BUILDDIR}
> ./.github/workflows/codechecker.sh --gcc --codechecker --build-dir ${BUILDDIR}
> 
> gcc reports are starting here
> 
> bschubert2@imesrv6 libfuse.git>stg series
> + mount_service-add-systemd
> + mount_service-create-high
> + mount_service-use-the-new
> + mount_service-update-mtab
> + util-hoist-the-fuse.conf
> + util-fix-checkpatch-complaints
> + mount_service-enable
> > mount.fuse3-integrate-systemd
> 
> 
> bschubert2@imesrv6 libfuse.git>git show |head -n5
> commit f908bb1504eca167e156671dde957c2e7192b7d2
> Author: Darrick J. Wong <djwong@kernel.org>
> Date:   Wed Mar 4 13:48:55 2026 -0800
> 
>     mount.fuse3: integrate systemd service startup
> 
> 
> ---==== Severity Statistics ====----
> ----------------------------
> Severity | Number of reports
> ----------------------------
> MEDIUM   |                 1
> ----------------------------
> ----=================----
> 
> ----==== Checker Statistics ====----
> -----------------------------------------------------
> Checker name           | Severity | Number of reports
> -----------------------------------------------------
> gcc-deref-before-check | MEDIUM   |                 1

Oh, that's concerning.  Could you figure out exactly what it's
complaining about and send that to me, please?

--D

> -----------------------------------------------------
> ----=================----
> 
> ----==== File Statistics ====----
> --------------------------------
> File name    | Number of reports
> --------------------------------
> mount.fuse.c |                 1
> --------------------------------
> ----=================----
> 
> ----======== Summary ========----
> ----------------------------------------------
> Number of processed analyzer result files | 45
> Number of analyzer reports                | 1 
> ----------------------------------------------
> ----=================----
> 
> To view statistics in a browser run:
> > firefox /home/bschubert2/src/libfuse/libfuse.git/build-without-examples/codechecker-html/statistics.html
> 
> To view the results in a browser run:
> > firefox /home/bschubert2/src/libfuse/libfuse.git/build-without-examples/codechecker-html/index.html
> [INFO 2026-05-02 18:25] - ----==== Summary ====----
> [INFO 2026-05-02 18:25] - Up-to-date analysis results
> [INFO 2026-05-02 18:25] -   gcc: 37
> [INFO 2026-05-02 18:25] - Outdated analysis results
> [INFO 2026-05-02 18:25] - Failed to analyze
> [INFO 2026-05-02 18:25] - Missing analysis results
> [INFO 2026-05-02 18:25] -   clangsa: 37
> [INFO 2026-05-02 18:25] -   clang-tidy: 37
> [INFO 2026-05-02 18:25] -   cppcheck: 37
> [INFO 2026-05-02 18:25] -   infer: 37
> [INFO 2026-05-02 18:25] - Total analyzed compilation commands: 45
> [INFO 2026-05-02 18:25] - Total available compilation commands: 45
> [INFO 2026-05-02 18:25] - ----=================----
> bschubert2@imesrv6 libfuse.git>
> 
> 
> 
> 

^ permalink raw reply

* Re: [GIT PULL v5.1] libfuse: run fuse servers as a contained service
From: Bernd Schubert @ 2026-05-02 19:51 UTC (permalink / raw)
  To: Darrick J. Wong
  Cc: fuse-devel, joannelkoong, linux-ext4, linux-fsdevel, miklos, neal
In-Reply-To: <20260502190543.GG3778109@frogsfrogsfrogs>



On 5/2/26 21:05, Darrick J. Wong wrote:
> On Sat, May 02, 2026 at 06:26:16PM +0200, Bernd Schubert wrote:
>>
>>
>> On 5/2/26 17:59, Bernd Schubert wrote:
>>>
>>>
>>> On 5/1/26 00:49, Darrick J. Wong wrote:
>>>> On Thu, Apr 30, 2026 at 11:34:06PM +0200, Bernd Schubert wrote:
>>>>> Hi Darrick,
>>>>>
>>>>> On 4/30/26 23:18, Darrick J. Wong wrote:
>>>>>> Hi Bernd,
>>>>>>
>>>>>> Please pull this branch with changes for libfuse.
>>>>>>
>>>>>> As usual, I did a test-merge with the main upstream branch as of a few
>>>>>> minutes ago, and didn't see any conflicts.  Please let me know if you
>>>>>> encounter any problems.
>>>>>
>>>>> pushed to my github branch. BSD build fails with
>>>>>
>>>>> 2026-04-30T21:25:16.3874802Z FAILED: [code=1] lib/libfuse3.so.3.19.0 
>>>>> 2026-04-30T21:25:16.3906762Z cc  -o lib/libfuse3.so.3.19.0 lib/libfuse3.so.3.19.0.p/fuse.c.o lib/libfuse3.so.3.19.0.p/fuse_loop.c.o lib/libfuse3.so.3.19.0.p/fuse_loop_mt.c.o lib/libfuse3.so.3.19.0.p/fuse_lowlevel.c.o lib/libfuse3.so.3.19.0.p/fuse_opt.c.o lib/libfuse3.so.3.19.0.p/fuse_signals.c.o lib/libfuse3.so.3.19.0.p/buffer.c.o lib/libfuse3.so.3.19.0.p/cuse_lowlevel.c.o lib/libfuse3.so.3.19.0.p/helper.c.o lib/libfuse3.so.3.19.0.p/modules_subdir.c.o lib/libfuse3.so.3.19.0.p/mount_util.c.o lib/libfuse3.so.3.19.0.p/fuse_log.c.o lib/libfuse3.so.3.19.0.p/compat.c.o lib/libfuse3.so.3.19.0.p/util.c.o lib/libfuse3.so.3.19.0.p/mount_bsd.c.o lib/libfuse3.so.3.19.0.p/fuse_service_stub.c.o lib/libfuse3.so.3.19.0.p/modules_iconv.c.o -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,-soname,libfuse3.so.4 -Wl,--version-script,/home/runner/work/libfuse/libfuse/lib/fuse_versionscript -pthread -Wl,--start-group -ldl -lrt -Wl,--end-group
>>>>> 2026-04-30T21:25:16.3939590Z ld: error: version script assignment of 'FUSE_3.19' to symbol 'fuse_service_can_allow_other' failed: symbol not defined
>>>>
>>>> Aha, that function got left out of the stub. :(
>>>>
>>>> Annoyingly, on Linux the build succeeds despite the missing symbol
>>>> when I tweak meson so that it doesn't build the service stuff.  I would
>>>> have thought that --no-undefined would have done that, but alas.
>>>>
>>>> Sorry about that too.  The following patch fixes it.
>>>>
>>>> diff --git i/lib/fuse_service_stub.c w/lib/fuse_service_stub.c
>>>> index d34df3891a6e31..231b98423df628 100644
>>>> --- i/lib/fuse_service_stub.c
>>>> +++ w/lib/fuse_service_stub.c
>>>> @@ -49,12 +49,17 @@ int fuse_service_send_goodbye(struct fuse_service *sf, int error)
>>>>  int fuse_service_accept(struct fuse_service **sfp)
>>>>  {
>>>>  	*sfp = NULL;
>>>>  	return 0;
>>>>  }
>>>>  
>>>> +bool fuse_service_can_allow_other(struct fuse_service *sf)
>>>> +{
>>>> +	return false;
>>>> +}
>>>> +
>>>>  int fuse_service_append_args(struct fuse_service *sf,
>>>>  			     struct fuse_args *existing_args)
>>>>  {
>>>>  	return -EOPNOTSUPP;
>>>>  }
>>>>  
>>>>
>>>>> 2026-04-30T21:25:16.3951874Z cc: error: linker command failed with exit code 1 (use -v to see invocation)
>>>>> 2026-04-30T21:25:16.4291582Z [44/82] cc -Itest/test_teardown_watchdog.p -Itest -I../test -Iinclude -I../include -Ilib -I../lib -I. -I.. -fdiagnostics-color=always -
>>>>>
>>>>>
>>>>> checkpatch, CodeChecker-cppcheck, CodeChecker-gcc also all fail. This CodeQL
>>>>
>>>> Not sure why checkpatch fails, this is what I got (Debian 13):
>>>>
>>>> $ git diff origin/master.. | ./checkpatch.pl --max-line-length=100 --no-tree --ignore MAINTAINERS,SPDX_LICENSE_TAG,COMMIT_MESSAGE,FILE_PATH_CHANGES,EMAIL_SUBJECT,AVOID_EXTERNS,GIT_COMMIT_ID,ENOSYS_SYSCALL,ENOSYS,FROM_SIGN_OFF_MISMATCH,QUOTED_COMMIT_ID,,PREFER_ATTRIBUTE_ALWAYS_UNUSED,PREFER_DEFINED_ATTRIBUTE_MACRO,STRCPY,STRNCPY -
>>>> No typos will be found - file '/storage/home/djwong/cdev/work/libfuse/spelling.txt': No such file or directory
>>>> No structs that should be const will be found - file '/storage/home/djwong/cdev/work/libfuse/const_structs.checkpatch': No such file or directory
>>>> total: 0 errors, 0 warnings, 3908 lines checked
>>>>
>>>> Your patch has no obvious style problems and is ready for submission.
>>>>
>>>> NOTE: Ignored message types: AVOID_EXTERNS COMMIT_MESSAGE EMAIL_SUBJECT ENOSYS ENOSYS_SYSCALL FILE_PATH_CHANGES FROM_SIGN_OFF_MISMATCH GIT_COMMIT_ID MAINTAINERS PREFER_ATTRIBUTE_ALWAYS_UNUSED PREFER_DEFINED_ATTRIBUTE_MACRO QUOTED_COMMIT_ID SPDX_LICENSE_TAG STRCPY STRNCPY
>>>>
>>>> cppcheck had a few things to say, but none of it was about the changed
>>>> lines.
>>>>
>>>>> report is funny
>>>>>
>>>>>> int mount_service_main(int argc, char *argv[])
>>>>>> Warning
>>>>>> Poorly documented large function
>>>>>> Poorly documented function: fewer than 2% comments for a function of 113 lines.
>>>>>> CodeQL
>>>>
>>>> Hrmm.  I guess I'll have to figure out how to get those things running.
>>>> That said, the stuff in mount_service.c is internal to libfuse (i.e.
>>>> it's not public library API) so I didn't comment them as intensely.
>>>> Would you like more?
>>>>
>>>>> I think I'm going to merge my sync fuse init series tomorrow.
>>>>
>>>> Yay!
>>>>
>>>>> Are you ok if skip posting another version of the series?
>>>>
>>>>                ^ is there an "I" here?  e.g. "...if I skip posting..."?
>>>>
>>>> /My/ normal practice (from xfs) was to repost the series as it was
>>>> merged, followed by an announcement.  That way the mailing list is a
>>>> complete record of what was merged.  However, very very few people
>>>> actually do that, even in the kernel.
>>>>
>>>> I'm ok with you not posting another version of the series.
>>>>
>>>>> Or do you prefer to review the recent changes and last piece I'm going
>>>>> to do tomorrow?
>>>>
>>>> Nah, just merge it.  I'll look over the changes once it's in the branch
>>>> and if there's anything weird, you or I or anyone else can send patches.
>>>> As long as you're not planning to tag it as a release, nothing's set in
>>>> stone.
>>>>
>>>>> Basically my goal is to rebase your series against it immediately and
>>>>> to merge your series during the next few days.
>>>>
>>>> <nod> Let me know what you want changed, I'll be around since I am not
>>>> travelling anywhere for a couple of weeks. :)
>>>>
>>>> I can reflow changes into the patchset, or if you'd prefer, I can add
>>>> them as new patches that would go on the end of the series.
>>>>
>>>
>>> Hi Darrick,
>>>
>>> eventually merged my patches and made a quick rebase and conflict 
>>> resolving with your branch. Github still reports plenty of issues ;)
>>>
>>> Could you fix all of the checkpatch isssues? This one shows plenty
>>> "util: hoist the fuse.conf parsing and setuid mode enforcement code"
>>>
>>> bschubert2@imesrv6 libfuse.git>stg series
>>> + mount_service-add-systemd
>>> + mount_service-create-high
>>> + mount_service-use-the-new
>>> + mount_service-update-mtab
>>>> util-hoist-the-fuse.conf
>>> - util-fix-checkpatch-complaints
>>> - mount_service-enable
>>> - mount.fuse3-integrate-systemd
>>> - mount_service-allow
>>> - example-service_ll-create-a
>>> - example-service-create-a
>>> - nullfs-support-fuse-systemd
>>> - meson-show-feature-summary
>>> bschubert2@imesrv6 libfuse.git>.github/workflows/run-checkpatch.sh 
>>> No typos will be found - file '/home/bschubert2/src/libfuse/libfuse.git/spelling.txt': No such file or directory
>>> No structs that should be const will be found - file '/home/bschubert2/src/libfuse/libfuse.git/const_structs.checkpatch': No such file or directory
>>> ERROR:GLOBAL_INITIALISERS: do not initialise globals to 0
>>> #61: FILE: util/fuser_conf.c:33:
>>> +int user_allow_other = 0;
>>>
>>> WARNING:LINE_SPACING: Missing a blank line after declarations
>>> #74: FILE: util/fuser_conf.c:46:
>>> +	char *dest = buf;
>>> +	while (1) {
>>>
>>> ...
>>>
>>> I don't have a strong opinion about these two above - feel 
>>> free to disable them. However, in order to merge it, it would
>>> be good to run without any checkpatch report.
>>> And everything that cppcheck and gcc-checker reports, definitely 
>>> need to be fixed.
>>
>> Basically
>>
>> cd <$FUSEDIR>
>> BUILDDIR="build-without-examples"
>> mkdir -p ${BUILDDIR}
>> meson setup ${BUILDDIR} -Dexamples=false 
>> ninja -C ${BUILDDIR}
>> ./.github/workflows/codechecker.sh --gcc --codechecker --build-dir ${BUILDDIR}
>>
>> gcc reports are starting here
>>
>> bschubert2@imesrv6 libfuse.git>stg series
>> + mount_service-add-systemd
>> + mount_service-create-high
>> + mount_service-use-the-new
>> + mount_service-update-mtab
>> + util-hoist-the-fuse.conf
>> + util-fix-checkpatch-complaints
>> + mount_service-enable
>>> mount.fuse3-integrate-systemd
>>
>>
>> bschubert2@imesrv6 libfuse.git>git show |head -n5
>> commit f908bb1504eca167e156671dde957c2e7192b7d2
>> Author: Darrick J. Wong <djwong@kernel.org>
>> Date:   Wed Mar 4 13:48:55 2026 -0800
>>
>>     mount.fuse3: integrate systemd service startup
>>
>>
>> ---==== Severity Statistics ====----
>> ----------------------------
>> Severity | Number of reports
>> ----------------------------
>> MEDIUM   |                 1
>> ----------------------------
>> ----=================----
>>
>> ----==== Checker Statistics ====----
>> -----------------------------------------------------
>> Checker name           | Severity | Number of reports
>> -----------------------------------------------------
>> gcc-deref-before-check | MEDIUM   |                 1
> 
> Oh, that's concerning.  Could you figure out exactly what it's
> complaining about and send that to me, please?

I'm afraid I don't manage anymore today. Still a couple of
other things to do (like changing laptop keyboard and packing
a few things, preparing bread for the oven).

It is really easy to run this yourself

cd <$FUSEDIR>
BUILDDIR="build-without-examples"
mkdir -p ${BUILDDIR}
meson setup ${BUILDDIR} -Dexamples=false 
ninja -C ${BUILDDIR}
./.github/workflows/codechecker.sh --gcc --codechecker --build-dir ${BUILDDIR}

There is --gcc and --cppcheck





^ permalink raw reply

* Re: [RFC] ext4: possible inconsistency in ext4_append() error path
From: Jan Kara @ 2026-05-03 17:23 UTC (permalink / raw)
  To: Vineet Agarwal
  Cc: tytso, linux-ext4, adilger.kernel, libaokun, jack, ojaswin,
	ritesh.list, yi.zhang, linux-kernel
In-Reply-To: <20260501172506.563064-1-agarwal.vineet2006@gmail.com>

Hi!

On Fri 01-05-26 22:55:06, Vineet Agarwal wrote:
> While looking into ext4 directory operations, I noticed a possible
> inconsistency in the error handling of ext4_append().
> 
> In ext4_append(), the inode size is updated before all failure points
> have been ruled out:
> 
>     bh = ext4_bread(handle, inode, *block, EXT4_GET_BLOCKS_CREATE);
>     if (IS_ERR(bh))
>         return bh;
> 
>     inode->i_size += inode->i_sb->s_blocksize;
>     EXT4_I(inode)->i_disksize = inode->i_size;
> 
>     err = ext4_mark_inode_dirty(handle, inode);
>     if (err)
>         goto out;
> 
>     err = ext4_journal_get_write_access(handle, inode->i_sb, bh,
>                                         EXT4_JTR_NONE);
>     if (err)
>         goto out;
> 
> If either ext4_mark_inode_dirty() or
> ext4_journal_get_write_access() fails, the function returns an
> error but does not restore the original inode size.
> 
> Callers of ext4_append() appear to treat it as an all-or-nothing
> operation:
> 
>     bh = ext4_append(handle, dir, &block);
>     if (IS_ERR(bh))
>         goto out;
> 
> However, in the failure case, inode->i_size may already have been
> increased.

Right.

> One possible consequence is that subsequent checks relying on i_size,
> such as:
> 
>     if (block >= inode->i_size >> inode->i_blkbits)
> 
> may allow a block index to pass bounds checks even though the append
> operation did not complete successfully.
> 
> I understand that journaling may ensure on-disk consistency, but the
> in-memory inode state may still temporarily reflect a change that did
> not logically succeed.
> 
> Is this behavior intentional, or should ext4_append() avoid updating
> i_size until after all failure points, or roll it back on error?

The thing is: If any of the above calls you mention fail, the filesystem
journal is aborted and the filesystem doesn't accept any more
modifications. So we are kind of sloppy with error recovery since it cannot
reach on-disk state. I'm not aware where the increased inode size on
failing ext4_append() would cause issues (besides further error complaints)
but if you find some such, yes, we can improve the error recovery path.

								Honza

-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply

* Re: [GIT PULL v5.1] libfuse: run fuse servers as a contained service
From: Bernd Schubert @ 2026-05-04 15:41 UTC (permalink / raw)
  To: Darrick J. Wong
  Cc: fuse-devel, joannelkoong, linux-ext4, linux-fsdevel, miklos, neal
In-Reply-To: <757367d0-3a8b-4de8-aa86-f74f316b3445@bsbernd.com>

[-- Attachment #1: Type: text/plain, Size: 369 bytes --]



On 5/2/26 21:51, Bernd Schubert wrote:
> 
>> Oh, that's concerning.  Could you figure out exactly what it's
>> complaining about and send that to me, please?
> 
Hi Darrick,

just pushed a new branch version that should avoid all chekpatch
warnings (squash of yours and fix of one I had introduced).


Please find attached all the CodeChecker warnings.


Thanks,
Bernd

[-- Attachment #2: codechecker.tar.gz --]
[-- Type: application/gzip, Size: 379241 bytes --]

^ permalink raw reply

* Re: [GIT PULL v5.1] libfuse: run fuse servers as a contained service
From: Darrick J. Wong @ 2026-05-04 17:43 UTC (permalink / raw)
  To: Bernd Schubert
  Cc: fuse-devel, joannelkoong, linux-ext4, linux-fsdevel, miklos, neal
In-Reply-To: <14222a33-62a3-4c8f-b86f-7c5ee47c9db7@bsbernd.com>

On Mon, May 04, 2026 at 05:41:38PM +0200, Bernd Schubert wrote:
> 
> 
> On 5/2/26 21:51, Bernd Schubert wrote:
> > 
> >> Oh, that's concerning.  Could you figure out exactly what it's
> >> complaining about and send that to me, please?
> > 
> Hi Darrick,
> 
> just pushed a new branch version that should avoid all chekpatch
> warnings (squash of yours and fix of one I had introduced).

Ok, thanks.  I'll have a look, thanks.

> Please find attached all the CodeChecker warnings.

<nod> I'll try to eliminate as many of these as possible.  I think the
complaints about "can be declared as pointer to const struct" are easily
amended.

The ones involving char **argv might be a little trickier though.
Anyway, I'll try to have something ready to send out before morning in
Europe, assuming that either you're at LSFMM or at least in a similar
timezone.

Also thanks for sending the tarball, it's useful (a) to know which
cppcheck complaints you want fixed, and (b) to compare against the
version on my system (Debian 13).

--D

^ permalink raw reply

* [syzbot] [ocfs2?] [ext4?] general protection fault in jbd2_journal_dirty_metadata (2)
From: syzbot @ 2026-05-04 22:27 UTC (permalink / raw)
  To: jack, jlbec, joseph.qi, linux-ext4, linux-kernel, mark,
	ocfs2-devel, syzkaller-bugs, tytso

Hello,

syzbot found the following issue on:

HEAD commit:    08d0d3466664 Merge tag 'net-7.1-rc2' of git://git.kernel.o..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=152f81ce580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=4caf64b1ee83dac0
dashboard link: https://syzkaller.appspot.com/bug?extid=98f651460e558a21baae
compiler:       Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=1415f2d2580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=132f81ce580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/c5abd4fcc5ba/disk-08d0d346.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/896c46fd9ce9/vmlinux-08d0d346.xz
kernel image: https://storage.googleapis.com/syzbot-assets/04a44a684bb3/bzImage-08d0d346.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/b6c8c7ca94d0/mount_0.gz
  fsck result: OK (log: https://syzkaller.appspot.com/x/fsck.log?x=14e8a082580000)

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+98f651460e558a21baae@syzkaller.appspotmail.com

(syz.2.23,6028,0):__ocfs2_remove_xattr_range:786 ERROR: status = -30
(syz.2.23,6028,0):ocfs2_xattr_shrink_size:840 ERROR: status = -30
(syz.2.23,6028,0):__ocfs2_journal_access:724 ERROR: Error -30 getting 1 access to buffer!
(syz.2.23,6028,0):ocfs2_xa_prepare_entry:2182 ERROR: status = -30
(syz.2.23,6028,0):ocfs2_xa_set:2285 ERROR: status = -30
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] SMP KASAN NOPTI
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 0 UID: 0 PID: 6028 Comm: syz.2.23 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026
RIP: 0010:jbd2_journal_dirty_metadata+0x4a/0xd30 fs/jbd2/transaction.c:1520
Code: 00 fc ff df e8 07 27 29 ff 4c 89 fd 48 c1 ed 03 42 80 7c 35 00 00 74 08 4c 89 ff e8 f0 61 94 ff 49 8b 1f 48 89 d8 48 c1 e8 03 <42> 80 3c 30 00 74 08 48 89 df e8 d7 61 94 ff 48 89 1c 24 4c 8b 2b
RSP: 0018:ffffc90003766bc0 EFLAGS: 00010256
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff888035c3dc40
RDX: 0000000000000000 RSI: ffff88805927b9f8 RDI: ffff888034ddbf20
RBP: 1ffff110069bb7e4 R08: ffffffff9030a1f7 R09: 1ffffffff206143e
R10: dffffc0000000000 R11: fffffbfff206143f R12: dffffc0000000000
R13: 1ffff920006ecd94 R14: dffffc0000000000 R15: ffff888034ddbf20
FS:  000055556c64d500(0000) GS:ffff888125290000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f8ff9c72700 CR3: 000000007908f000 CR4: 0000000000350ef0
Call Trace:
 <TASK>
 ocfs2_journal_dirty+0x130/0x700 fs/ocfs2/journal.c:831
 ocfs2_xa_journal_dirty fs/ocfs2/xattr.c:1483 [inline]
 ocfs2_xa_set+0x15e3/0x2ec0 fs/ocfs2/xattr.c:2294
 ocfs2_xattr_block_set+0x3e0/0x33c0 fs/ocfs2/xattr.c:3016
 __ocfs2_xattr_set_handle+0x6b3/0xf50 fs/ocfs2/xattr.c:3418
 ocfs2_xattr_set+0xf3f/0x13e0 fs/ocfs2/xattr.c:3681
 __vfs_setxattr+0x43c/0x480 fs/xattr.c:218
 __vfs_setxattr_noperm+0x12d/0x660 fs/xattr.c:252
 vfs_setxattr+0x163/0x360 fs/xattr.c:339
 do_setxattr fs/xattr.c:654 [inline]
 filename_setxattr+0x296/0x630 fs/xattr.c:682
 path_setxattrat+0x3eb/0x440 fs/xattr.c:726
 __do_sys_setxattr fs/xattr.c:760 [inline]
 __se_sys_setxattr fs/xattr.c:756 [inline]
 __x64_sys_setxattr+0xbc/0xe0 fs/xattr.c:756
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f8ff9d9cdd9
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd9c92e118 EFLAGS: 00000246 ORIG_RAX: 00000000000000bc
RAX: ffffffffffffffda RBX: 00007f8ffa015fa0 RCX: 00007f8ff9d9cdd9
RDX: 0000000000000000 RSI: 0000200000000140 RDI: 0000200000000080
RBP: 00007f8ff9e32d69 R08: 0000000000000002 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f8ffa015fac R14: 00007f8ffa015fa0 R15: 00007f8ffa015fa0
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:jbd2_journal_dirty_metadata+0x4a/0xd30 fs/jbd2/transaction.c:1520
Code: 00 fc ff df e8 07 27 29 ff 4c 89 fd 48 c1 ed 03 42 80 7c 35 00 00 74 08 4c 89 ff e8 f0 61 94 ff 49 8b 1f 48 89 d8 48 c1 e8 03 <42> 80 3c 30 00 74 08 48 89 df e8 d7 61 94 ff 48 89 1c 24 4c 8b 2b
RSP: 0018:ffffc90003766bc0 EFLAGS: 00010256
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff888035c3dc40
RDX: 0000000000000000 RSI: ffff88805927b9f8 RDI: ffff888034ddbf20
RBP: 1ffff110069bb7e4 R08: ffffffff9030a1f7 R09: 1ffffffff206143e
R10: dffffc0000000000 R11: fffffbfff206143f R12: dffffc0000000000
R13: 1ffff920006ecd94 R14: dffffc0000000000 R15: ffff888034ddbf20
FS:  000055556c64d500(0000) GS:ffff888125290000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000557909eb6950 CR3: 000000007908f000 CR4: 0000000000350ef0
----------------
Code disassembly (best guess), 4 bytes skipped:
   0:	e8 07 27 29 ff       	call   0xff29270c
   5:	4c 89 fd             	mov    %r15,%rbp
   8:	48 c1 ed 03          	shr    $0x3,%rbp
   c:	42 80 7c 35 00 00    	cmpb   $0x0,0x0(%rbp,%r14,1)
  12:	74 08                	je     0x1c
  14:	4c 89 ff             	mov    %r15,%rdi
  17:	e8 f0 61 94 ff       	call   0xff94620c
  1c:	49 8b 1f             	mov    (%r15),%rbx
  1f:	48 89 d8             	mov    %rbx,%rax
  22:	48 c1 e8 03          	shr    $0x3,%rax
* 26:	42 80 3c 30 00       	cmpb   $0x0,(%rax,%r14,1) <-- trapping instruction
  2b:	74 08                	je     0x35
  2d:	48 89 df             	mov    %rbx,%rdi
  30:	e8 d7 61 94 ff       	call   0xff94620c
  35:	48 89 1c 24          	mov    %rbx,(%rsp)
  39:	4c 8b 2b             	mov    (%rbx),%r13


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

^ permalink raw reply

* [PATCH 3/7] libsupport: don't use bzero in cache.c
From: Theodore Ts'o @ 2026-05-04 23:32 UTC (permalink / raw)
  To: Ext4 Developers List; +Cc: Darrick J. Wong, Theodore Ts'o
In-Reply-To: <20260504233301.2345652-1-tytso@mit.edu>

The bzero() function is deprecated and not available in some
platforms.  It's not needed in any case because we can just use an
automatic initializer.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Fixes: 30b3c80ed6bc ("libsupport: add a cache")
---
 lib/support/cache.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lib/support/cache.c b/lib/support/cache.c
index f9669e3fc..aec785347 100644
--- a/lib/support/cache.c
+++ b/lib/support/cache.c
@@ -850,7 +850,7 @@ cache_report(
 {
 	int		i;
 	unsigned long	count, index, total;
-	unsigned long	hash_bucket_lengths[HASH_REPORT + 2];
+	unsigned long	hash_bucket_lengths[HASH_REPORT + 2] = { 0 };
 
 	if ((cache->c_hits + cache->c_misses) == 0)
 		return;
@@ -886,8 +886,6 @@ cache_report(
 		cache->c_mrus[i].cm_count * 100 / cache->c_count);
 
 	/* report hash bucket lengths */
-	bzero(hash_bucket_lengths, sizeof(hash_bucket_lengths));
-
 	for (i = 0; i < cache->c_hashsize; i++) {
 		count = cache->c_hash[i].ch_count;
 		if (count > HASH_REPORT)
-- 
2.53.0


^ permalink raw reply related

* [PATCH 4/7] fuse[24]fs: suppress clang warnings which were breaking the github CI
From: Theodore Ts'o @ 2026-05-04 23:32 UTC (permalink / raw)
  To: Ext4 Developers List; +Cc: Darrick J. Wong, Theodore Ts'o
In-Reply-To: <20260504233301.2345652-1-tytso@mit.edu>

fuse[24]fs.c defines some functions which might or might not be used
depending on the version of the fuse library installed on the system.
Unfortunately while gcc won't complain if there are static inline
functions which are not used, clang will only suppress such complaints
if the static inline functions are in a header file.

Since the github CI runs a test build with -Wall -Werror this was
breaking the CI build.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 fuse4fs/fuse4fs.c | 21 +++++++++++++++++++++
 misc/fuse2fs.c    | 21 +++++++++++++++++++++
 2 files changed, 42 insertions(+)

diff --git a/fuse4fs/fuse4fs.c b/fuse4fs/fuse4fs.c
index 13e1aae4b..b883083f8 100644
--- a/fuse4fs/fuse4fs.c
+++ b/fuse4fs/fuse4fs.c
@@ -502,6 +502,27 @@ static inline off_t FUSE4FS_FSB_TO_B(const struct fuse4fs *ff, blk64_t bno)
 	return bno << ff->blocklog;
 }
 
+#ifdef __clang__
+#define SUPPRESS_UNUSED_FUNCTION(func)    (void)func
+/*
+ * These functions might or might not be used depending on the version
+ * of the fuse library installed on the system.  Unfortunately while
+ * gcc won't complain if there are static inline functions which are
+ * not used, clang will only suppress such complaints if the static
+ * inline functions are in a header file.
+ */
+void fuse2fs_shut_up_stupid_clang_warnings(void)
+{
+	SUPPRESS_UNUSED_FUNCTION(fuse2fs_shut_up_stupid_clang_warnings);
+	SUPPRESS_UNUSED_FUNCTION(round_up);
+	SUPPRESS_UNUSED_FUNCTION(round_down);
+	SUPPRESS_UNUSED_FUNCTION(FUSE4FS_B_TO_FSBT);
+	SUPPRESS_UNUSED_FUNCTION(FUSE4FS_OFF_IN_FSB);
+	SUPPRESS_UNUSED_FUNCTION(FUSE4FS_B_TO_FSB);
+	SUPPRESS_UNUSED_FUNCTION(FUSE4FS_FSB_TO_B);
+}
+#endif
+
 static double gettime_monotonic(void)
 {
 #ifdef CLOCK_MONOTONIC
diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c
index 0f4781bc4..c46cfc236 100644
--- a/misc/fuse2fs.c
+++ b/misc/fuse2fs.c
@@ -339,6 +339,27 @@ static inline off_t FUSE2FS_FSB_TO_B(const struct fuse2fs *ff, blk64_t bno)
 	return bno << ff->blocklog;
 }
 
+#ifdef __clang__
+#define SUPPRESS_UNUSED_FUNCTION(func)    (void)func
+/*
+ * These functions might or might not be used depending on the version
+ * of the fuse library installed on the system.  Unfortunately while
+ * gcc won't complain if there are static inline functions which are
+ * not used, clang will only suppress such complaints if the static
+ * inline functions are in a header file.
+ */
+void fuse2fs_shut_up_stupid_clang_warnings(void)
+{
+	SUPPRESS_UNUSED_FUNCTION(fuse2fs_shut_up_stupid_clang_warnings);
+	SUPPRESS_UNUSED_FUNCTION(round_up);
+	SUPPRESS_UNUSED_FUNCTION(round_down);
+	SUPPRESS_UNUSED_FUNCTION(FUSE2FS_B_TO_FSBT);
+	SUPPRESS_UNUSED_FUNCTION(FUSE2FS_OFF_IN_FSB);
+	SUPPRESS_UNUSED_FUNCTION(FUSE2FS_B_TO_FSB);
+	SUPPRESS_UNUSED_FUNCTION(FUSE2FS_FSB_TO_B);
+}
+#endif
+
 static double gettime_monotonic(void)
 {
 #ifdef CLOCK_MONOTONIC
-- 
2.53.0


^ permalink raw reply related

* [PATCH 1/7] libsupport: drop xbitops.h and define fls() if necessary
From: Theodore Ts'o @ 2026-05-04 23:32 UTC (permalink / raw)
  To: Ext4 Developers List; +Cc: Darrick J. Wong, Theodore Ts'o
In-Reply-To: <20260504233301.2345652-1-tytso@mit.edu>

The new cache.c file doesn't actually need most of the functions in
xbitops.h.  It only needs fls(), and on some systems, like MacOS and
*BSD systems, fls() is defined already.  The other functions in
xbitops.h are massively non-portable and break on non-Linux systems,
especially MacOS.

So define fls() if it's needed (on Linux), and drop xbitops.h.

Fixes: 30b3c80ed6bc ("libsupport: add a cache")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 configure               |   6 ++
 configure.ac            |   1 +
 fuse4fs/Makefile.in     |  18 +++---
 lib/config.h.in         |   3 +
 lib/support/Makefile.in |   2 +-
 lib/support/cache.c     |  33 ++++++++++-
 lib/support/xbitops.h   | 128 ----------------------------------------
 7 files changed, 51 insertions(+), 140 deletions(-)
 delete mode 100644 lib/support/xbitops.h

diff --git a/configure b/configure
index a97794121..a1a270e63 100755
--- a/configure
+++ b/configure
@@ -13677,6 +13677,12 @@ if test "x$ac_cv_func_fdatasync" = xyes
 then :
   printf "%s\n" "#define HAVE_FDATASYNC 1" >>confdefs.h
 
+fi
+ac_fn_c_check_func "$LINENO" "fls" "ac_cv_func_fls"
+if test "x$ac_cv_func_fls" = xyes
+then :
+  printf "%s\n" "#define HAVE_FLS 1" >>confdefs.h
+
 fi
 ac_fn_c_check_func "$LINENO" "fstat64" "ac_cv_func_fstat64"
 if test "x$ac_cv_func_fstat64" = xyes
diff --git a/configure.ac b/configure.ac
index b62553e3d..abce79594 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1233,6 +1233,7 @@ AC_CHECK_FUNCS(m4_flatten([
 	fchown
 	fcntl
 	fdatasync
+	fls
 	fstat64
 	fsync
 	ftruncate64
diff --git a/fuse4fs/Makefile.in b/fuse4fs/Makefile.in
index 9f3547c27..cecee2b25 100644
--- a/fuse4fs/Makefile.in
+++ b/fuse4fs/Makefile.in
@@ -134,7 +134,7 @@ distclean: clean
 	$(RM) -f .depend Makefile $(srcdir)/TAGS $(srcdir)/Makefile.in.old
 
 # +++ Dependency line eater +++
-#
+# 
 # Makefile dependencies follow.  This must be the last section in
 # the Makefile.in file
 #
@@ -145,9 +145,10 @@ fuse4fs.o: $(srcdir)/fuse4fs.c $(top_builddir)/lib/config.h \
  $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
  $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
  $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/ext2fs/ext2fsP.h \
- $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/version.h \
- $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/lib/support/cache.h \
- $(top_srcdir)/lib/support/list.h $(top_srcdir)/lib/support/xbitops.h
+ $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/support/bthread.h \
+ $(top_srcdir)/lib/support/thread.h $(top_srcdir)/lib/support/list.h \
+ $(top_srcdir)/lib/support/cache.h $(top_srcdir)/version.h \
+ $(top_srcdir)/lib/e2p/e2p.h
 journal.o: $(srcdir)/../debugfs/journal.c $(top_builddir)/lib/config.h \
  $(top_builddir)/lib/dirpaths.h $(srcdir)/../debugfs/journal.h \
  $(top_srcdir)/e2fsck/jfs_user.h $(top_srcdir)/e2fsck/e2fsck.h \
@@ -161,8 +162,7 @@ journal.o: $(srcdir)/../debugfs/journal.c $(top_builddir)/lib/config.h \
  $(top_srcdir)/lib/support/dqblk_v2.h \
  $(top_srcdir)/lib/support/quotaio_tree.h \
  $(top_srcdir)/lib/ext2fs/fast_commit.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
- $(top_srcdir)/lib/support/list.h $(top_srcdir)/lib/ext2fs/compiler.h \
- $(top_srcdir)/lib/ext2fs/kernel-jbd.h
+ $(top_srcdir)/lib/support/list.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h
 revoke.o: $(srcdir)/../e2fsck/revoke.c $(srcdir)/../e2fsck/jfs_user.h \
  $(top_builddir)/lib/config.h $(top_builddir)/lib/dirpaths.h \
  $(srcdir)/../e2fsck/e2fsck.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
@@ -175,8 +175,7 @@ revoke.o: $(srcdir)/../e2fsck/revoke.c $(srcdir)/../e2fsck/jfs_user.h \
  $(top_srcdir)/lib/support/dqblk_v2.h \
  $(top_srcdir)/lib/support/quotaio_tree.h \
  $(top_srcdir)/lib/ext2fs/fast_commit.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
- $(top_srcdir)/lib/support/list.h $(top_srcdir)/lib/ext2fs/compiler.h \
- $(top_srcdir)/lib/ext2fs/kernel-jbd.h
+ $(top_srcdir)/lib/support/list.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h
 recovery.o: $(srcdir)/../e2fsck/recovery.c $(srcdir)/../e2fsck/jfs_user.h \
  $(top_builddir)/lib/config.h $(top_builddir)/lib/dirpaths.h \
  $(srcdir)/../e2fsck/e2fsck.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
@@ -189,5 +188,4 @@ recovery.o: $(srcdir)/../e2fsck/recovery.c $(srcdir)/../e2fsck/jfs_user.h \
  $(top_srcdir)/lib/support/dqblk_v2.h \
  $(top_srcdir)/lib/support/quotaio_tree.h \
  $(top_srcdir)/lib/ext2fs/fast_commit.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
- $(top_srcdir)/lib/support/list.h $(top_srcdir)/lib/ext2fs/compiler.h \
- $(top_srcdir)/lib/ext2fs/kernel-jbd.h
+ $(top_srcdir)/lib/support/list.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h
diff --git a/lib/config.h.in b/lib/config.h.in
index fd2520396..abba5e2c6 100644
--- a/lib/config.h.in
+++ b/lib/config.h.in
@@ -124,6 +124,9 @@
 /* Define to 1 if you have the 'fdatasync' function. */
 #undef HAVE_FDATASYNC
 
+/* Define to 1 if you have the 'fls' function. */
+#undef HAVE_FLS
+
 /* Define to 1 if fsmap_sizeof() is declared in linux/fsmap.h */
 #undef HAVE_FSMAP_SIZEOF
 
diff --git a/lib/support/Makefile.in b/lib/support/Makefile.in
index 6ff1c81d0..d20d6a984 100644
--- a/lib/support/Makefile.in
+++ b/lib/support/Makefile.in
@@ -199,4 +199,4 @@ dict.o: $(srcdir)/dict.c $(top_builddir)/lib/config.h \
 devname.o: $(srcdir)/devname.c $(top_builddir)/lib/config.h \
  $(top_builddir)/lib/dirpaths.h $(srcdir)/devname.h $(srcdir)/nls-enable.h
 cache.o: $(srcdir)/cache.c $(top_builddir)/lib/config.h \
- $(srcdir)/cache.h $(srcdir)/list.h $(srcdir)/xbitops.h
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/list.h $(srcdir)/cache.h
diff --git a/lib/support/cache.c b/lib/support/cache.c
index 3a9e276f1..f9669e3fc 100644
--- a/lib/support/cache.c
+++ b/lib/support/cache.c
@@ -7,6 +7,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <unistd.h>
 #include <pthread.h>
 #include <stdbool.h>
@@ -14,9 +15,9 @@
 #include <stdint.h>
 #include <errno.h>
 
+#include "config.h"
 #include "list.h"
 #include "cache.h"
-#include "xbitops.h"
 
 #undef CACHE_DEBUG
 /* #define CACHE_DEBUG 1 */
@@ -32,6 +33,36 @@
 # define ASSERT(x)		do { } while (0)
 #endif
 
+#ifndef HAVE_FLS
+static inline int fls(int x)
+{
+	int r = 32;
+
+	if (!x)
+		return 0;
+	if (!(x & 0xffff0000u)) {
+		x = (x & 0xffffu) << 16;
+		r -= 16;
+	}
+	if (!(x & 0xff000000u)) {
+		x = (x & 0xffffffu) << 8;
+		r -= 8;
+	}
+	if (!(x & 0xf0000000u)) {
+		x = (x & 0xfffffffu) << 4;
+		r -= 4;
+	}
+	if (!(x & 0xc0000000u)) {
+		x = (x & 0x3fffffffu) << 2;
+		r -= 2;
+	}
+	if (!(x & 0x80000000u)) {
+		r -= 1;
+	}
+	return r;
+}
+#endif
+
 static unsigned int cache_generic_bulkrelse(struct cache *, struct list_head *);
 
 int
diff --git a/lib/support/xbitops.h b/lib/support/xbitops.h
deleted file mode 100644
index 78a8f2a85..000000000
--- a/lib/support/xbitops.h
+++ /dev/null
@@ -1,128 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#ifndef __BITOPS_H__
-#define __BITOPS_H__
-
-/*
- * fls: find last bit set.
- */
-
-static inline int fls(int x)
-{
-	int r = 32;
-
-	if (!x)
-		return 0;
-	if (!(x & 0xffff0000u)) {
-		x = (x & 0xffffu) << 16;
-		r -= 16;
-	}
-	if (!(x & 0xff000000u)) {
-		x = (x & 0xffffffu) << 8;
-		r -= 8;
-	}
-	if (!(x & 0xf0000000u)) {
-		x = (x & 0xfffffffu) << 4;
-		r -= 4;
-	}
-	if (!(x & 0xc0000000u)) {
-		x = (x & 0x3fffffffu) << 2;
-		r -= 2;
-	}
-	if (!(x & 0x80000000u)) {
-		r -= 1;
-	}
-	return r;
-}
-
-static inline int fls64(uint64_t x)
-{
-	uint32_t h = x >> 32;
-	if (h)
-		return fls(h) + 32;
-	return fls(x);
-}
-
-static inline unsigned fls_long(unsigned long l)
-{
-        if (sizeof(l) == 4)
-                return fls(l);
-        return fls64(l);
-}
-
-/*
- * ffz: find first zero bit.
- * Result is undefined if no zero bit exists.
- */
-#define ffz(x)	ffs(~(x))
-
-/*
- * XFS bit manipulation routines.  Repeated here so that some programs
- * don't have to link in all of libxfs just to have bit manipulation.
- */
-
-/*
- * masks with n high/low bits set, 64-bit values
- */
-static inline uint64_t mask64hi(int n)
-{
-	return (uint64_t)-1 << (64 - (n));
-}
-static inline uint32_t mask32lo(int n)
-{
-	return ((uint32_t)1 << (n)) - 1;
-}
-static inline uint64_t mask64lo(int n)
-{
-	return ((uint64_t)1 << (n)) - 1;
-}
-
-/* Get high bit set out of 32-bit argument, -1 if none set */
-static inline int highbit32(uint32_t v)
-{
-	return fls(v) - 1;
-}
-
-/* Get high bit set out of 64-bit argument, -1 if none set */
-static inline int highbit64(uint64_t v)
-{
-	return fls64(v) - 1;
-}
-
-/* Get low bit set out of 32-bit argument, -1 if none set */
-static inline int lowbit32(uint32_t v)
-{
-	return ffs(v) - 1;
-}
-
-/* Get low bit set out of 64-bit argument, -1 if none set */
-static inline int lowbit64(uint64_t v)
-{
-	uint32_t	w = (uint32_t)v;
-	int		n = 0;
-
-	if (w) {	/* lower bits */
-		n = ffs(w);
-	} else {	/* upper bits */
-		w = (uint32_t)(v >> 32);
-		if (w) {
-			n = ffs(w);
-			if (n)
-				n += 32;
-		}
-	}
-	return n - 1;
-}
-
-/**
- * __rounddown_pow_of_two() - round down to nearest power of two
- * @n: value to round down
- */
-static inline __attribute__((const))
-unsigned long __rounddown_pow_of_two(unsigned long n)
-{
-	return 1UL << (fls_long(n) - 1);
-}
-
-#define rounddown_pow_of_two(n) __rounddown_pow_of_two(n)
-
-#endif
-- 
2.53.0


^ permalink raw reply related

* [PATCH 2/7] configure.ac: fix disable fuse2fs/fuse4fs by default path
From: Theodore Ts'o @ 2026-05-04 23:32 UTC (permalink / raw)
  To: Ext4 Developers List; +Cc: Darrick J. Wong, Theodore Ts'o
In-Reply-To: <20260504233301.2345652-1-tytso@mit.edu>

If the fuse.h header file is not present, fix the "Disabling
fuse[24]fs by default" codepath to actually disable trying to build
fuse2fs or fuse4fs.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Fixes: 239f4b7ac05b ("fuse2fs: separate libfuse3 and fuse2fs detection in configure")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 configure    | 2 ++
 configure.ac | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/configure b/configure
index a1a270e63..d941ff1f1 100755
--- a/configure
+++ b/configure
@@ -14737,6 +14737,7 @@ else case e in #(
 		{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Enabling fuse2fs by default" >&5
 printf "%s\n" "Enabling fuse2fs by default" >&6; }
 	else
+		FUSE2FS_CMT="#"
 		{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Disabling fuse2fs by default" >&5
 printf "%s\n" "Disabling fuse2fs by default" >&6; }
 	fi
@@ -14804,6 +14805,7 @@ else case e in #(
 		{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Enabling fuse4fs by default" >&5
 printf "%s\n" "Enabling fuse4fs by default" >&6; }
 	else
+		FUSE4FS_CMT="#"
 		{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Disabling fuse4fs by default" >&5
 printf "%s\n" "Disabling fuse4fs by default" >&6; }
 	fi
diff --git a/configure.ac b/configure.ac
index abce79594..d8f40f5df 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1459,6 +1459,7 @@ AS_HELP_STRING([--disable-fuse2fs],[do not build fuse2fs]),
 	then
 		AC_MSG_RESULT([Enabling fuse2fs by default])
 	else
+		FUSE2FS_CMT="#"
 		AC_MSG_RESULT([Disabling fuse2fs by default])
 	fi
 ]
@@ -1496,6 +1497,7 @@ AS_HELP_STRING([--disable-fuse4fs],[do not build fuse4fs]),
 	then
 		AC_MSG_RESULT([Enabling fuse4fs by default])
 	else
+		FUSE4FS_CMT="#"
 		AC_MSG_RESULT([Disabling fuse4fs by default])
 	fi
 ]
-- 
2.53.0


^ permalink raw reply related

* [PATCH 0/7] fix up issues from djwong/fuse4fs-fork
From: Theodore Ts'o @ 2026-05-04 23:32 UTC (permalink / raw)
  To: Ext4 Developers List; +Cc: Darrick J. Wong, Theodore Ts'o

These are the patches that I've applied to the next branch to clean up
found when trying to compile e2fsprogs on MacOS and via the github's
continuous integration testing.

Note: See .github/workflows/ci.yaml; it's a good reason to get a
github account if you are doing a lot of e2fsprogs development.
If you fork my e2fsprogs repository and push your changes to your github
repo, you can get reports like the ones found here:
      https://github.com/tytso/e2fsprogs/actions


Anyway, with these patches, e2fsprogs builds on MacOS (both using the
github CI and on locally on my Macbook).  Unfortunately fuse2fs has
regressed in that non-root accesses are getting denied with a permission
denied on MacOS, and this worked with e2fsprogs v1.47.4.  Here's a
lightly edited transcript from my Macbook Air:

% uname -a
Darwin macsyma.local 25.4.0 Darwin Kernel Version 25.4.0: Thu Mar 19 19:33:09 PDT 2026; root:xnu-12377.101.15~1/RELEASE_ARM64_T8112 arm64 arm Darwin
% ./mke2fs -Fq -t ext4 -d . /tmp/foo.img  1G
% ./fuse2fs -o allow_other /tmp/foo.img /Users/tytso/mnt
FUSE2FS (foo.img): Warning: fuse2fs does not support using the journal.
There may be file system corruption or data loss if
the file system is not gracefully unmounted.
% stat /Users/tytso/mnt/revoke.o
stat: cannot stat '/Users/tytso/mnt/revoke.o': Permission denied
% sudo stat /Users/tytso/mnt/revoke.o
  File: /Users/tytso/mnt/revoke.o
  Size: 29728     	Blocks: 64         IO Block: 16384  regular file
Device: 55,270	Inode: 91          Links: 1
Access: (0644/-rw-r--r--)  Uid: (15806/   tytso)   Gid: (   20/   staff)
Access: 2026-05-05 00:21:50.000000000 +0200
Modify: 2026-05-05 00:21:50.000000000 +0200
Change: 2026-05-05 00:21:50.000000000 +0200
 Birth: -
% stat revoke.o
  File: revoke.o
  Size: 29728     	Blocks: 64         IO Block: 4096   regular file
Device: 1,18	Inode: 851374      Links: 1
Access: (0644/-rw-r--r--)  Uid: (15806/   tytso)   Gid: (   20/   staff)
Access: 2026-05-05 00:21:50.903084819 +0200
Modify: 2026-05-05 00:21:50.346338295 +0200
Change: 2026-05-05 00:21:50.346580544 +0200
 Birth: 2026-05-05 00:21:50.293229053 +0200
% sum revoke.o
45116    30 revoke.o
% sum /Users/tytso/mnt/revoke.o
sum: /Users/tytso/mnt/revoke.o: Permission denied

So fuse2fs is broken on MacOS, but it's not *totally* broken, since you
can still use it as root.  I'll want to fix this before updating the
master branch, but this is good enough for the next branch.



Theodore Ts'o (7):
  libsupport: drop xbitops.h and define fls() if necessary
  configure.ac: fix disable fuse2fs/fuse4fs by default path
  libsupport: don't use bzero in cache.c
  fuse[24]fs: suppress clang warnings which were breaking the github CI
  libsupport: remove the LIST_HEAD macro from list.h
  libsupport: fix gcc -Wall warnings
  fuse2fs: fix uninitialized variable warnings

 configure               |   8 +++
 configure.ac            |   3 +
 fuse4fs/Makefile.in     |  18 +++---
 fuse4fs/fuse4fs.c       |  29 +++++++--
 lib/config.h.in         |   3 +
 lib/support/Makefile.in |   2 +-
 lib/support/cache.c     |  49 ++++++++++++---
 lib/support/cache.h     |   2 +-
 lib/support/list.h      |  17 ++++--
 lib/support/xbitops.h   | 128 ----------------------------------------
 misc/fuse2fs.c          |  21 +++++++
 11 files changed, 125 insertions(+), 155 deletions(-)
 delete mode 100644 lib/support/xbitops.h

-- 
2.53.0


^ permalink raw reply

* [PATCH 7/7] fuse2fs: fix uninitialized variable warnings
From: Theodore Ts'o @ 2026-05-04 23:33 UTC (permalink / raw)
  To: Ext4 Developers List; +Cc: Darrick J. Wong, Theodore Ts'o
In-Reply-To: <20260504233301.2345652-1-tytso@mit.edu>

Clang treats use of unitialized variables found by static analysis to
be serious enough that it will emit them by default (even without
-Wall).  So let's fix them up.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 fuse4fs/fuse4fs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fuse4fs/fuse4fs.c b/fuse4fs/fuse4fs.c
index b883083f8..928473268 100644
--- a/fuse4fs/fuse4fs.c
+++ b/fuse4fs/fuse4fs.c
@@ -2216,7 +2216,7 @@ static void op_mknod(fuse_req_t req, fuse_ino_t fino, const char *name,
 	const struct fuse_ctx *ctxt = fuse_req_ctx(req);
 	struct fuse4fs *ff = fuse4fs_get(req);
 	ext2_filsys fs;
-	ext2_ino_t parent, child;
+	ext2_ino_t parent, child = 0;
 	errcode_t err;
 	int filetype;
 	gid_t gid;
@@ -2311,7 +2311,7 @@ static void op_mkdir(fuse_req_t req, fuse_ino_t fino, const char *name,
 	const struct fuse_ctx *ctxt = fuse_req_ctx(req);
 	struct fuse4fs *ff = fuse4fs_get(req);
 	ext2_filsys fs;
-	ext2_ino_t parent, child;
+	ext2_ino_t parent, child = 0;
 	errcode_t err;
 	char *block;
 	blk64_t blk;
@@ -2990,7 +2990,7 @@ static void op_symlink(fuse_req_t req, const char *target, fuse_ino_t fino,
 	const struct fuse_ctx *ctxt = fuse_req_ctx(req);
 	struct fuse4fs *ff = fuse4fs_get(req);
 	ext2_filsys fs;
-	ext2_ino_t parent, child;
+	ext2_ino_t parent, child = 0;
 	errcode_t err;
 	gid_t gid;
 	int ret = 0;
@@ -6042,7 +6042,7 @@ static int fuse4fs_main(struct fuse_args *args, struct fuse4fs *ff)
 	struct fuse_cmdline_opts opts;
 	struct fuse_session *se;
 	struct fuse_loop_config *loop_config = NULL;
-	int ret;
+	int ret = 0;
 
 	if (fuse_parse_cmdline(args, &opts) != 0) {
 		ret = 1;
-- 
2.53.0


^ permalink raw reply related

* [PATCH 5/7] libsupport: remove the LIST_HEAD macro from list.h
From: Theodore Ts'o @ 2026-05-04 23:32 UTC (permalink / raw)
  To: Ext4 Developers List; +Cc: Darrick J. Wong, Theodore Ts'o
In-Reply-To: <20260504233301.2345652-1-tytso@mit.edu>

The LIST_HEAD macro is defined by both the Linux kernel's list.h and
<sys/queue.h> (originally from BSD).  The problem is that on MacOS,
some system header file pulls in <sys/queue.h> leading to a macro
redefiniction conflict.  Since we don't use LIST_HEAD in e2fsprogs,
the simplest mitigation is to just comment out the definition of LIST_HEAD.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Fixes: 37dafcc0894b ("libsupport: port the kernel list.h to libsupport")
---
 lib/support/list.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/support/list.h b/lib/support/list.h
index 0e00e446d..0ec8de525 100644
--- a/lib/support/list.h
+++ b/lib/support/list.h
@@ -36,8 +36,17 @@ static inline void list_head_destroy(struct list_head *list)
 
 #define LIST_HEAD_INIT(name) { &(name), &(name) }
 
+#if 0
+/*
+ * This conflicts with the LIST_HEAD defined in <sys/queue.h>.  We
+ * don't include it in e2fsprogs, but some systems' header files might
+ * pull it in, leading to the macro redefinition conflict.
+ * Fortunately, we also don't need LIST_HEAD in e2fsprogs, so just
+ * drop this convenience macro.
+ */
 #define LIST_HEAD(name) \
 	struct list_head name = LIST_HEAD_INIT(name)
+#endif
 
 /**
  * INIT_LIST_HEAD - Initialize a list_head structure
-- 
2.53.0


^ permalink raw reply related

* [PATCH 6/7] libsupport: fix gcc -Wall warnings
From: Theodore Ts'o @ 2026-05-04 23:33 UTC (permalink / raw)
  To: Ext4 Developers List; +Cc: Darrick J. Wong, Theodore Ts'o
In-Reply-To: <20260504233301.2345652-1-tytso@mit.edu>

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 lib/support/cache.c | 12 +++++++++---
 lib/support/cache.h |  2 +-
 lib/support/list.h  |  8 ++++----
 3 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/lib/support/cache.c b/lib/support/cache.c
index aec785347..ece0adece 100644
--- a/lib/support/cache.c
+++ b/lib/support/cache.c
@@ -15,6 +15,12 @@
 #include <stdint.h>
 #include <errno.h>
 
+#ifdef __GNUC__
+#define EXT2FS_ATTR(x) __attribute__(x)
+#else
+#define EXT2FS_ATTR(x)
+#endif
+
 #include "config.h"
 #include "list.h"
 #include "cache.h"
@@ -711,7 +717,7 @@ cache_node_put(
 
 void
 cache_node_set_priority(
-	struct cache *		cache,
+	struct cache *		cache EXT2FS_ATTR((unused)),
 	struct cache_node *	node,
 	int			priority)
 {
@@ -820,7 +826,7 @@ cache_flush(
 {
 	struct cache_hash	*hash;
 	struct cache_node	*node;
-	int			i;
+	unsigned int		i;
 	bool			still_dirty = false;
 
 	if (!cache->flush)
@@ -848,7 +854,7 @@ cache_report(
 	const char	*name,
 	struct cache	*cache)
 {
-	int		i;
+	unsigned int	i;
 	unsigned long	count, index, total;
 	unsigned long	hash_bucket_lengths[HASH_REPORT + 2] = { 0 };
 
diff --git a/lib/support/cache.h b/lib/support/cache.h
index 71fb9762f..cd0e8c20e 100644
--- a/lib/support/cache.h
+++ b/lib/support/cache.h
@@ -83,7 +83,7 @@ typedef unsigned int (*cache_node_resize_t)(const struct cache *c,
 					    unsigned int curr_size,
 					    int dir);
 
-static inline unsigned int cache_gradual_resize(const struct cache *cache,
+static inline unsigned int cache_gradual_resize(const struct cache *cache EXT2FS_ATTR((unused)),
 						unsigned int curr_size,
 						int dir)
 {
diff --git a/lib/support/list.h b/lib/support/list.h
index 0ec8de525..54e8e2360 100644
--- a/lib/support/list.h
+++ b/lib/support/list.h
@@ -148,13 +148,13 @@ static __always_inline bool __list_del_entry_valid(struct list_head *entry)
 	return ret;
 }
 #else
-static inline bool __list_add_valid(struct list_head *new,
-				struct list_head *prev,
-				struct list_head *next)
+static inline bool __list_add_valid(struct list_head *new EXT2FS_ATTR((unused)),
+				struct list_head *prev EXT2FS_ATTR((unused)),
+				struct list_head *next EXT2FS_ATTR((unused)))
 {
 	return true;
 }
-static inline bool __list_del_entry_valid(struct list_head *entry)
+static inline bool __list_del_entry_valid(struct list_head *entry EXT2FS_ATTR((unused)))
 {
 	return true;
 }
-- 
2.53.0


^ permalink raw reply related

* Re: [PATCH 0/7] fix up issues from djwong/fuse4fs-fork
From: Darrick J. Wong @ 2026-05-05  0:08 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: Ext4 Developers List
In-Reply-To: <20260504233301.2345652-1-tytso@mit.edu>

On Mon, May 04, 2026 at 07:32:54PM -0400, Theodore Ts'o wrote:
> These are the patches that I've applied to the next branch to clean up
> found when trying to compile e2fsprogs on MacOS and via the github's
> continuous integration testing.
> 
> Note: See .github/workflows/ci.yaml; it's a good reason to get a
> github account if you are doing a lot of e2fsprogs development.
> If you fork my e2fsprogs repository and push your changes to your github
> repo, you can get reports like the ones found here:
>       https://github.com/tytso/e2fsprogs/actions
> 
> 
> Anyway, with these patches, e2fsprogs builds on MacOS (both using the
> github CI and on locally on my Macbook).  Unfortunately fuse2fs has
> regressed in that non-root accesses are getting denied with a permission
> denied on MacOS, and this worked with e2fsprogs v1.47.4.  Here's a
> lightly edited transcript from my Macbook Air:

Hm, curious.  It's regrettable that I no longer have a Mac, and
therefore can't really do much investigating.  If you give
-o default_permissions,allow_other , does that fix the problem?
If that fixes it, then fuse2fs has a bug somewhere in its own
permissions checking.

> % uname -a
> Darwin macsyma.local 25.4.0 Darwin Kernel Version 25.4.0: Thu Mar 19 19:33:09 PDT 2026; root:xnu-12377.101.15~1/RELEASE_ARM64_T8112 arm64 arm Darwin
> % ./mke2fs -Fq -t ext4 -d . /tmp/foo.img  1G
> % ./fuse2fs -o allow_other /tmp/foo.img /Users/tytso/mnt
> FUSE2FS (foo.img): Warning: fuse2fs does not support using the journal.
> There may be file system corruption or data loss if
> the file system is not gracefully unmounted.
> % stat /Users/tytso/mnt/revoke.o
> stat: cannot stat '/Users/tytso/mnt/revoke.o': Permission denied
> % sudo stat /Users/tytso/mnt/revoke.o
>   File: /Users/tytso/mnt/revoke.o
>   Size: 29728     	Blocks: 64         IO Block: 16384  regular file
> Device: 55,270	Inode: 91          Links: 1
> Access: (0644/-rw-r--r--)  Uid: (15806/   tytso)   Gid: (   20/   staff)
> Access: 2026-05-05 00:21:50.000000000 +0200
> Modify: 2026-05-05 00:21:50.000000000 +0200
> Change: 2026-05-05 00:21:50.000000000 +0200
>  Birth: -
> % stat revoke.o
>   File: revoke.o
>   Size: 29728     	Blocks: 64         IO Block: 4096   regular file
> Device: 1,18	Inode: 851374      Links: 1
> Access: (0644/-rw-r--r--)  Uid: (15806/   tytso)   Gid: (   20/   staff)
> Access: 2026-05-05 00:21:50.903084819 +0200
> Modify: 2026-05-05 00:21:50.346338295 +0200
> Change: 2026-05-05 00:21:50.346580544 +0200
>  Birth: 2026-05-05 00:21:50.293229053 +0200
> % sum revoke.o
> 45116    30 revoke.o
> % sum /Users/tytso/mnt/revoke.o
> sum: /Users/tytso/mnt/revoke.o: Permission denied

That's really strange.  Does MacOS do any strange idmapping stuff?

I'm also curious if there's a particular commit that makes it all work
again?  There are a few defaults that changed between fuse2 and fuse3,
and since MacFuse claims to have vendored both, it could very well be
the megacommit dropping the fuse2 api support.

--D

> So fuse2fs is broken on MacOS, but it's not *totally* broken, since you
> can still use it as root.  I'll want to fix this before updating the
> master branch, but this is good enough for the next branch.
> 
> 
> 
> Theodore Ts'o (7):
>   libsupport: drop xbitops.h and define fls() if necessary
>   configure.ac: fix disable fuse2fs/fuse4fs by default path
>   libsupport: don't use bzero in cache.c
>   fuse[24]fs: suppress clang warnings which were breaking the github CI
>   libsupport: remove the LIST_HEAD macro from list.h
>   libsupport: fix gcc -Wall warnings
>   fuse2fs: fix uninitialized variable warnings
> 
>  configure               |   8 +++
>  configure.ac            |   3 +
>  fuse4fs/Makefile.in     |  18 +++---
>  fuse4fs/fuse4fs.c       |  29 +++++++--
>  lib/config.h.in         |   3 +
>  lib/support/Makefile.in |   2 +-
>  lib/support/cache.c     |  49 ++++++++++++---
>  lib/support/cache.h     |   2 +-
>  lib/support/list.h      |  17 ++++--
>  lib/support/xbitops.h   | 128 ----------------------------------------
>  misc/fuse2fs.c          |  21 +++++++
>  11 files changed, 125 insertions(+), 155 deletions(-)
>  delete mode 100644 lib/support/xbitops.h
> 
> -- 
> 2.53.0
> 
> 

^ permalink raw reply

* Re: [PATCH 1/7] libsupport: drop xbitops.h and define fls() if necessary
From: Darrick J. Wong @ 2026-05-05  0:11 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: Ext4 Developers List
In-Reply-To: <20260504233301.2345652-2-tytso@mit.edu>

On Mon, May 04, 2026 at 07:32:55PM -0400, Theodore Ts'o wrote:
> The new cache.c file doesn't actually need most of the functions in
> xbitops.h.  It only needs fls(), and on some systems, like MacOS and
> *BSD systems, fls() is defined already.  The other functions in
> xbitops.h are massively non-portable and break on non-Linux systems,
> especially MacOS.
> 
> So define fls() if it's needed (on Linux), and drop xbitops.h.
> 
> Fixes: 30b3c80ed6bc ("libsupport: add a cache")
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>

Works for me; in the end I didn't use it as many places as I thought I
was going to.
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  configure               |   6 ++
>  configure.ac            |   1 +
>  fuse4fs/Makefile.in     |  18 +++---
>  lib/config.h.in         |   3 +
>  lib/support/Makefile.in |   2 +-
>  lib/support/cache.c     |  33 ++++++++++-
>  lib/support/xbitops.h   | 128 ----------------------------------------
>  7 files changed, 51 insertions(+), 140 deletions(-)
>  delete mode 100644 lib/support/xbitops.h
> 
> diff --git a/configure b/configure
> index a97794121..a1a270e63 100755
> --- a/configure
> +++ b/configure
> @@ -13677,6 +13677,12 @@ if test "x$ac_cv_func_fdatasync" = xyes
>  then :
>    printf "%s\n" "#define HAVE_FDATASYNC 1" >>confdefs.h
>  
> +fi
> +ac_fn_c_check_func "$LINENO" "fls" "ac_cv_func_fls"
> +if test "x$ac_cv_func_fls" = xyes
> +then :
> +  printf "%s\n" "#define HAVE_FLS 1" >>confdefs.h
> +
>  fi
>  ac_fn_c_check_func "$LINENO" "fstat64" "ac_cv_func_fstat64"
>  if test "x$ac_cv_func_fstat64" = xyes
> diff --git a/configure.ac b/configure.ac
> index b62553e3d..abce79594 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1233,6 +1233,7 @@ AC_CHECK_FUNCS(m4_flatten([
>  	fchown
>  	fcntl
>  	fdatasync
> +	fls
>  	fstat64
>  	fsync
>  	ftruncate64
> diff --git a/fuse4fs/Makefile.in b/fuse4fs/Makefile.in
> index 9f3547c27..cecee2b25 100644
> --- a/fuse4fs/Makefile.in
> +++ b/fuse4fs/Makefile.in
> @@ -134,7 +134,7 @@ distclean: clean
>  	$(RM) -f .depend Makefile $(srcdir)/TAGS $(srcdir)/Makefile.in.old
>  
>  # +++ Dependency line eater +++
> -#
> +# 
>  # Makefile dependencies follow.  This must be the last section in
>  # the Makefile.in file
>  #
> @@ -145,9 +145,10 @@ fuse4fs.o: $(srcdir)/fuse4fs.c $(top_builddir)/lib/config.h \
>   $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
>   $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
>   $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/ext2fs/ext2fsP.h \
> - $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/version.h \
> - $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/lib/support/cache.h \
> - $(top_srcdir)/lib/support/list.h $(top_srcdir)/lib/support/xbitops.h
> + $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/support/bthread.h \
> + $(top_srcdir)/lib/support/thread.h $(top_srcdir)/lib/support/list.h \
> + $(top_srcdir)/lib/support/cache.h $(top_srcdir)/version.h \
> + $(top_srcdir)/lib/e2p/e2p.h
>  journal.o: $(srcdir)/../debugfs/journal.c $(top_builddir)/lib/config.h \
>   $(top_builddir)/lib/dirpaths.h $(srcdir)/../debugfs/journal.h \
>   $(top_srcdir)/e2fsck/jfs_user.h $(top_srcdir)/e2fsck/e2fsck.h \
> @@ -161,8 +162,7 @@ journal.o: $(srcdir)/../debugfs/journal.c $(top_builddir)/lib/config.h \
>   $(top_srcdir)/lib/support/dqblk_v2.h \
>   $(top_srcdir)/lib/support/quotaio_tree.h \
>   $(top_srcdir)/lib/ext2fs/fast_commit.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
> - $(top_srcdir)/lib/support/list.h $(top_srcdir)/lib/ext2fs/compiler.h \
> - $(top_srcdir)/lib/ext2fs/kernel-jbd.h
> + $(top_srcdir)/lib/support/list.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h
>  revoke.o: $(srcdir)/../e2fsck/revoke.c $(srcdir)/../e2fsck/jfs_user.h \
>   $(top_builddir)/lib/config.h $(top_builddir)/lib/dirpaths.h \
>   $(srcdir)/../e2fsck/e2fsck.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
> @@ -175,8 +175,7 @@ revoke.o: $(srcdir)/../e2fsck/revoke.c $(srcdir)/../e2fsck/jfs_user.h \
>   $(top_srcdir)/lib/support/dqblk_v2.h \
>   $(top_srcdir)/lib/support/quotaio_tree.h \
>   $(top_srcdir)/lib/ext2fs/fast_commit.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
> - $(top_srcdir)/lib/support/list.h $(top_srcdir)/lib/ext2fs/compiler.h \
> - $(top_srcdir)/lib/ext2fs/kernel-jbd.h
> + $(top_srcdir)/lib/support/list.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h
>  recovery.o: $(srcdir)/../e2fsck/recovery.c $(srcdir)/../e2fsck/jfs_user.h \
>   $(top_builddir)/lib/config.h $(top_builddir)/lib/dirpaths.h \
>   $(srcdir)/../e2fsck/e2fsck.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
> @@ -189,5 +188,4 @@ recovery.o: $(srcdir)/../e2fsck/recovery.c $(srcdir)/../e2fsck/jfs_user.h \
>   $(top_srcdir)/lib/support/dqblk_v2.h \
>   $(top_srcdir)/lib/support/quotaio_tree.h \
>   $(top_srcdir)/lib/ext2fs/fast_commit.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
> - $(top_srcdir)/lib/support/list.h $(top_srcdir)/lib/ext2fs/compiler.h \
> - $(top_srcdir)/lib/ext2fs/kernel-jbd.h
> + $(top_srcdir)/lib/support/list.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h
> diff --git a/lib/config.h.in b/lib/config.h.in
> index fd2520396..abba5e2c6 100644
> --- a/lib/config.h.in
> +++ b/lib/config.h.in
> @@ -124,6 +124,9 @@
>  /* Define to 1 if you have the 'fdatasync' function. */
>  #undef HAVE_FDATASYNC
>  
> +/* Define to 1 if you have the 'fls' function. */
> +#undef HAVE_FLS
> +
>  /* Define to 1 if fsmap_sizeof() is declared in linux/fsmap.h */
>  #undef HAVE_FSMAP_SIZEOF
>  
> diff --git a/lib/support/Makefile.in b/lib/support/Makefile.in
> index 6ff1c81d0..d20d6a984 100644
> --- a/lib/support/Makefile.in
> +++ b/lib/support/Makefile.in
> @@ -199,4 +199,4 @@ dict.o: $(srcdir)/dict.c $(top_builddir)/lib/config.h \
>  devname.o: $(srcdir)/devname.c $(top_builddir)/lib/config.h \
>   $(top_builddir)/lib/dirpaths.h $(srcdir)/devname.h $(srcdir)/nls-enable.h
>  cache.o: $(srcdir)/cache.c $(top_builddir)/lib/config.h \
> - $(srcdir)/cache.h $(srcdir)/list.h $(srcdir)/xbitops.h
> + $(top_builddir)/lib/dirpaths.h $(srcdir)/list.h $(srcdir)/cache.h
> diff --git a/lib/support/cache.c b/lib/support/cache.c
> index 3a9e276f1..f9669e3fc 100644
> --- a/lib/support/cache.c
> +++ b/lib/support/cache.c
> @@ -7,6 +7,7 @@
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <string.h>
> +#include <strings.h>
>  #include <unistd.h>
>  #include <pthread.h>
>  #include <stdbool.h>
> @@ -14,9 +15,9 @@
>  #include <stdint.h>
>  #include <errno.h>
>  
> +#include "config.h"
>  #include "list.h"
>  #include "cache.h"
> -#include "xbitops.h"
>  
>  #undef CACHE_DEBUG
>  /* #define CACHE_DEBUG 1 */
> @@ -32,6 +33,36 @@
>  # define ASSERT(x)		do { } while (0)
>  #endif
>  
> +#ifndef HAVE_FLS
> +static inline int fls(int x)
> +{
> +	int r = 32;
> +
> +	if (!x)
> +		return 0;
> +	if (!(x & 0xffff0000u)) {
> +		x = (x & 0xffffu) << 16;
> +		r -= 16;
> +	}
> +	if (!(x & 0xff000000u)) {
> +		x = (x & 0xffffffu) << 8;
> +		r -= 8;
> +	}
> +	if (!(x & 0xf0000000u)) {
> +		x = (x & 0xfffffffu) << 4;
> +		r -= 4;
> +	}
> +	if (!(x & 0xc0000000u)) {
> +		x = (x & 0x3fffffffu) << 2;
> +		r -= 2;
> +	}
> +	if (!(x & 0x80000000u)) {
> +		r -= 1;
> +	}
> +	return r;
> +}
> +#endif
> +
>  static unsigned int cache_generic_bulkrelse(struct cache *, struct list_head *);
>  
>  int
> diff --git a/lib/support/xbitops.h b/lib/support/xbitops.h
> deleted file mode 100644
> index 78a8f2a85..000000000
> --- a/lib/support/xbitops.h
> +++ /dev/null
> @@ -1,128 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0
> -#ifndef __BITOPS_H__
> -#define __BITOPS_H__
> -
> -/*
> - * fls: find last bit set.
> - */
> -
> -static inline int fls(int x)
> -{
> -	int r = 32;
> -
> -	if (!x)
> -		return 0;
> -	if (!(x & 0xffff0000u)) {
> -		x = (x & 0xffffu) << 16;
> -		r -= 16;
> -	}
> -	if (!(x & 0xff000000u)) {
> -		x = (x & 0xffffffu) << 8;
> -		r -= 8;
> -	}
> -	if (!(x & 0xf0000000u)) {
> -		x = (x & 0xfffffffu) << 4;
> -		r -= 4;
> -	}
> -	if (!(x & 0xc0000000u)) {
> -		x = (x & 0x3fffffffu) << 2;
> -		r -= 2;
> -	}
> -	if (!(x & 0x80000000u)) {
> -		r -= 1;
> -	}
> -	return r;
> -}
> -
> -static inline int fls64(uint64_t x)
> -{
> -	uint32_t h = x >> 32;
> -	if (h)
> -		return fls(h) + 32;
> -	return fls(x);
> -}
> -
> -static inline unsigned fls_long(unsigned long l)
> -{
> -        if (sizeof(l) == 4)
> -                return fls(l);
> -        return fls64(l);
> -}
> -
> -/*
> - * ffz: find first zero bit.
> - * Result is undefined if no zero bit exists.
> - */
> -#define ffz(x)	ffs(~(x))
> -
> -/*
> - * XFS bit manipulation routines.  Repeated here so that some programs
> - * don't have to link in all of libxfs just to have bit manipulation.
> - */
> -
> -/*
> - * masks with n high/low bits set, 64-bit values
> - */
> -static inline uint64_t mask64hi(int n)
> -{
> -	return (uint64_t)-1 << (64 - (n));
> -}
> -static inline uint32_t mask32lo(int n)
> -{
> -	return ((uint32_t)1 << (n)) - 1;
> -}
> -static inline uint64_t mask64lo(int n)
> -{
> -	return ((uint64_t)1 << (n)) - 1;
> -}
> -
> -/* Get high bit set out of 32-bit argument, -1 if none set */
> -static inline int highbit32(uint32_t v)
> -{
> -	return fls(v) - 1;
> -}
> -
> -/* Get high bit set out of 64-bit argument, -1 if none set */
> -static inline int highbit64(uint64_t v)
> -{
> -	return fls64(v) - 1;
> -}
> -
> -/* Get low bit set out of 32-bit argument, -1 if none set */
> -static inline int lowbit32(uint32_t v)
> -{
> -	return ffs(v) - 1;
> -}
> -
> -/* Get low bit set out of 64-bit argument, -1 if none set */
> -static inline int lowbit64(uint64_t v)
> -{
> -	uint32_t	w = (uint32_t)v;
> -	int		n = 0;
> -
> -	if (w) {	/* lower bits */
> -		n = ffs(w);
> -	} else {	/* upper bits */
> -		w = (uint32_t)(v >> 32);
> -		if (w) {
> -			n = ffs(w);
> -			if (n)
> -				n += 32;
> -		}
> -	}
> -	return n - 1;
> -}
> -
> -/**
> - * __rounddown_pow_of_two() - round down to nearest power of two
> - * @n: value to round down
> - */
> -static inline __attribute__((const))
> -unsigned long __rounddown_pow_of_two(unsigned long n)
> -{
> -	return 1UL << (fls_long(n) - 1);
> -}
> -
> -#define rounddown_pow_of_two(n) __rounddown_pow_of_two(n)
> -
> -#endif
> -- 
> 2.53.0
> 
> 

^ permalink raw reply

* Re: [PATCH 2/7] configure.ac: fix disable fuse2fs/fuse4fs by default path
From: Darrick J. Wong @ 2026-05-05  0:13 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: Ext4 Developers List
In-Reply-To: <20260504233301.2345652-3-tytso@mit.edu>

On Mon, May 04, 2026 at 07:32:56PM -0400, Theodore Ts'o wrote:
> If the fuse.h header file is not present, fix the "Disabling
> fuse[24]fs by default" codepath to actually disable trying to build
> fuse2fs or fuse4fs.
> 
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> Fixes: 239f4b7ac05b ("fuse2fs: separate libfuse3 and fuse2fs detection in configure")
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>

Oops.  I hadn't tried building without a fuse.h in a while. :/
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  configure    | 2 ++
>  configure.ac | 2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/configure b/configure
> index a1a270e63..d941ff1f1 100755
> --- a/configure
> +++ b/configure
> @@ -14737,6 +14737,7 @@ else case e in #(
>  		{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Enabling fuse2fs by default" >&5
>  printf "%s\n" "Enabling fuse2fs by default" >&6; }
>  	else
> +		FUSE2FS_CMT="#"
>  		{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Disabling fuse2fs by default" >&5
>  printf "%s\n" "Disabling fuse2fs by default" >&6; }
>  	fi
> @@ -14804,6 +14805,7 @@ else case e in #(
>  		{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Enabling fuse4fs by default" >&5
>  printf "%s\n" "Enabling fuse4fs by default" >&6; }
>  	else
> +		FUSE4FS_CMT="#"
>  		{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Disabling fuse4fs by default" >&5
>  printf "%s\n" "Disabling fuse4fs by default" >&6; }
>  	fi
> diff --git a/configure.ac b/configure.ac
> index abce79594..d8f40f5df 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1459,6 +1459,7 @@ AS_HELP_STRING([--disable-fuse2fs],[do not build fuse2fs]),
>  	then
>  		AC_MSG_RESULT([Enabling fuse2fs by default])
>  	else
> +		FUSE2FS_CMT="#"
>  		AC_MSG_RESULT([Disabling fuse2fs by default])
>  	fi
>  ]
> @@ -1496,6 +1497,7 @@ AS_HELP_STRING([--disable-fuse4fs],[do not build fuse4fs]),
>  	then
>  		AC_MSG_RESULT([Enabling fuse4fs by default])
>  	else
> +		FUSE4FS_CMT="#"
>  		AC_MSG_RESULT([Disabling fuse4fs by default])
>  	fi
>  ]
> -- 
> 2.53.0
> 
> 

^ permalink raw reply

* Re: [PATCH 3/7] libsupport: don't use bzero in cache.c
From: Darrick J. Wong @ 2026-05-05  0:15 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: Ext4 Developers List
In-Reply-To: <20260504233301.2345652-4-tytso@mit.edu>

On Mon, May 04, 2026 at 07:32:57PM -0400, Theodore Ts'o wrote:
> The bzero() function is deprecated and not available in some
> platforms.  It's not needed in any case because we can just use an
> automatic initializer.
> 
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> Fixes: 30b3c80ed6bc ("libsupport: add a cache")

Yeesh.  What a sordid legacy this function has (see manpage). :(
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  lib/support/cache.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/lib/support/cache.c b/lib/support/cache.c
> index f9669e3fc..aec785347 100644
> --- a/lib/support/cache.c
> +++ b/lib/support/cache.c
> @@ -850,7 +850,7 @@ cache_report(
>  {
>  	int		i;
>  	unsigned long	count, index, total;
> -	unsigned long	hash_bucket_lengths[HASH_REPORT + 2];
> +	unsigned long	hash_bucket_lengths[HASH_REPORT + 2] = { 0 };
>  
>  	if ((cache->c_hits + cache->c_misses) == 0)
>  		return;
> @@ -886,8 +886,6 @@ cache_report(
>  		cache->c_mrus[i].cm_count * 100 / cache->c_count);
>  
>  	/* report hash bucket lengths */
> -	bzero(hash_bucket_lengths, sizeof(hash_bucket_lengths));
> -
>  	for (i = 0; i < cache->c_hashsize; i++) {
>  		count = cache->c_hash[i].ch_count;
>  		if (count > HASH_REPORT)
> -- 
> 2.53.0
> 
> 

^ permalink raw reply

* Re: [PATCH 4/7] fuse[24]fs: suppress clang warnings which were breaking the github CI
From: Darrick J. Wong @ 2026-05-05  0:20 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: Ext4 Developers List
In-Reply-To: <20260504233301.2345652-5-tytso@mit.edu>

On Mon, May 04, 2026 at 07:32:58PM -0400, Theodore Ts'o wrote:
> fuse[24]fs.c defines some functions which might or might not be used
> depending on the version of the fuse library installed on the system.
> Unfortunately while gcc won't complain if there are static inline
> functions which are not used, clang will only suppress such complaints
> if the static inline functions are in a header file.

<groan>

> Since the github CI runs a test build with -Wall -Werror this was
> breaking the CI build.
> 
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> ---
>  fuse4fs/fuse4fs.c | 21 +++++++++++++++++++++
>  misc/fuse2fs.c    | 21 +++++++++++++++++++++
>  2 files changed, 42 insertions(+)
> 
> diff --git a/fuse4fs/fuse4fs.c b/fuse4fs/fuse4fs.c
> index 13e1aae4b..b883083f8 100644
> --- a/fuse4fs/fuse4fs.c
> +++ b/fuse4fs/fuse4fs.c
> @@ -502,6 +502,27 @@ static inline off_t FUSE4FS_FSB_TO_B(const struct fuse4fs *ff, blk64_t bno)
>  	return bno << ff->blocklog;
>  }
>  
> +#ifdef __clang__
> +#define SUPPRESS_UNUSED_FUNCTION(func)    (void)func
> +/*
> + * These functions might or might not be used depending on the version
> + * of the fuse library installed on the system.  Unfortunately while
> + * gcc won't complain if there are static inline functions which are
> + * not used, clang will only suppress such complaints if the static
> + * inline functions are in a header file.
> + */
> +void fuse2fs_shut_up_stupid_clang_warnings(void)
> +{
> +	SUPPRESS_UNUSED_FUNCTION(fuse2fs_shut_up_stupid_clang_warnings);

Why is this stupid recursive shi ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
even necessary?

> +	SUPPRESS_UNUSED_FUNCTION(round_up);
> +	SUPPRESS_UNUSED_FUNCTION(round_down);
> +	SUPPRESS_UNUSED_FUNCTION(FUSE4FS_B_TO_FSBT);
> +	SUPPRESS_UNUSED_FUNCTION(FUSE4FS_OFF_IN_FSB);
> +	SUPPRESS_UNUSED_FUNCTION(FUSE4FS_B_TO_FSB);
> +	SUPPRESS_UNUSED_FUNCTION(FUSE4FS_FSB_TO_B);

Hrmm some of these aren't strictly necessary, but ... oh.  The first
three are actively used in the punch hole helpers, but that only applies
on a platform that *supports* hole punching.  So my guess is that these
clang warnings appear on macos, where there isn't holepunching?

--D

> +}
> +#endif
> +
>  static double gettime_monotonic(void)
>  {
>  #ifdef CLOCK_MONOTONIC
> diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c
> index 0f4781bc4..c46cfc236 100644
> --- a/misc/fuse2fs.c
> +++ b/misc/fuse2fs.c
> @@ -339,6 +339,27 @@ static inline off_t FUSE2FS_FSB_TO_B(const struct fuse2fs *ff, blk64_t bno)
>  	return bno << ff->blocklog;
>  }
>  
> +#ifdef __clang__
> +#define SUPPRESS_UNUSED_FUNCTION(func)    (void)func
> +/*
> + * These functions might or might not be used depending on the version
> + * of the fuse library installed on the system.  Unfortunately while
> + * gcc won't complain if there are static inline functions which are
> + * not used, clang will only suppress such complaints if the static
> + * inline functions are in a header file.
> + */
> +void fuse2fs_shut_up_stupid_clang_warnings(void)
> +{
> +	SUPPRESS_UNUSED_FUNCTION(fuse2fs_shut_up_stupid_clang_warnings);
> +	SUPPRESS_UNUSED_FUNCTION(round_up);
> +	SUPPRESS_UNUSED_FUNCTION(round_down);
> +	SUPPRESS_UNUSED_FUNCTION(FUSE2FS_B_TO_FSBT);
> +	SUPPRESS_UNUSED_FUNCTION(FUSE2FS_OFF_IN_FSB);
> +	SUPPRESS_UNUSED_FUNCTION(FUSE2FS_B_TO_FSB);
> +	SUPPRESS_UNUSED_FUNCTION(FUSE2FS_FSB_TO_B);
> +}
> +#endif
> +
>  static double gettime_monotonic(void)
>  {
>  #ifdef CLOCK_MONOTONIC
> -- 
> 2.53.0
> 
> 

^ permalink raw reply

* Re: [PATCH 5/7] libsupport: remove the LIST_HEAD macro from list.h
From: Darrick J. Wong @ 2026-05-05  0:20 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: Ext4 Developers List
In-Reply-To: <20260504233301.2345652-6-tytso@mit.edu>

On Mon, May 04, 2026 at 07:32:59PM -0400, Theodore Ts'o wrote:
> The LIST_HEAD macro is defined by both the Linux kernel's list.h and
> <sys/queue.h> (originally from BSD).  The problem is that on MacOS,
> some system header file pulls in <sys/queue.h> leading to a macro
> redefiniction conflict.  Since we don't use LIST_HEAD in e2fsprogs,
> the simplest mitigation is to just comment out the definition of LIST_HEAD.
> 
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> Fixes: 37dafcc0894b ("libsupport: port the kernel list.h to libsupport")

Sounds fine to me.
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  lib/support/list.h | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/lib/support/list.h b/lib/support/list.h
> index 0e00e446d..0ec8de525 100644
> --- a/lib/support/list.h
> +++ b/lib/support/list.h
> @@ -36,8 +36,17 @@ static inline void list_head_destroy(struct list_head *list)
>  
>  #define LIST_HEAD_INIT(name) { &(name), &(name) }
>  
> +#if 0
> +/*
> + * This conflicts with the LIST_HEAD defined in <sys/queue.h>.  We
> + * don't include it in e2fsprogs, but some systems' header files might
> + * pull it in, leading to the macro redefinition conflict.
> + * Fortunately, we also don't need LIST_HEAD in e2fsprogs, so just
> + * drop this convenience macro.
> + */
>  #define LIST_HEAD(name) \
>  	struct list_head name = LIST_HEAD_INIT(name)
> +#endif
>  
>  /**
>   * INIT_LIST_HEAD - Initialize a list_head structure
> -- 
> 2.53.0
> 
> 

^ permalink raw reply

* Re: [PATCH 6/7] libsupport: fix gcc -Wall warnings
From: Darrick J. Wong @ 2026-05-05  0:20 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: Ext4 Developers List
In-Reply-To: <20260504233301.2345652-7-tytso@mit.edu>

On Mon, May 04, 2026 at 07:33:00PM -0400, Theodore Ts'o wrote:
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>

Looks good to me,
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  lib/support/cache.c | 12 +++++++++---
>  lib/support/cache.h |  2 +-
>  lib/support/list.h  |  8 ++++----
>  3 files changed, 14 insertions(+), 8 deletions(-)
> 
> diff --git a/lib/support/cache.c b/lib/support/cache.c
> index aec785347..ece0adece 100644
> --- a/lib/support/cache.c
> +++ b/lib/support/cache.c
> @@ -15,6 +15,12 @@
>  #include <stdint.h>
>  #include <errno.h>
>  
> +#ifdef __GNUC__
> +#define EXT2FS_ATTR(x) __attribute__(x)
> +#else
> +#define EXT2FS_ATTR(x)
> +#endif
> +
>  #include "config.h"
>  #include "list.h"
>  #include "cache.h"
> @@ -711,7 +717,7 @@ cache_node_put(
>  
>  void
>  cache_node_set_priority(
> -	struct cache *		cache,
> +	struct cache *		cache EXT2FS_ATTR((unused)),
>  	struct cache_node *	node,
>  	int			priority)
>  {
> @@ -820,7 +826,7 @@ cache_flush(
>  {
>  	struct cache_hash	*hash;
>  	struct cache_node	*node;
> -	int			i;
> +	unsigned int		i;
>  	bool			still_dirty = false;
>  
>  	if (!cache->flush)
> @@ -848,7 +854,7 @@ cache_report(
>  	const char	*name,
>  	struct cache	*cache)
>  {
> -	int		i;
> +	unsigned int	i;
>  	unsigned long	count, index, total;
>  	unsigned long	hash_bucket_lengths[HASH_REPORT + 2] = { 0 };
>  
> diff --git a/lib/support/cache.h b/lib/support/cache.h
> index 71fb9762f..cd0e8c20e 100644
> --- a/lib/support/cache.h
> +++ b/lib/support/cache.h
> @@ -83,7 +83,7 @@ typedef unsigned int (*cache_node_resize_t)(const struct cache *c,
>  					    unsigned int curr_size,
>  					    int dir);
>  
> -static inline unsigned int cache_gradual_resize(const struct cache *cache,
> +static inline unsigned int cache_gradual_resize(const struct cache *cache EXT2FS_ATTR((unused)),
>  						unsigned int curr_size,
>  						int dir)
>  {
> diff --git a/lib/support/list.h b/lib/support/list.h
> index 0ec8de525..54e8e2360 100644
> --- a/lib/support/list.h
> +++ b/lib/support/list.h
> @@ -148,13 +148,13 @@ static __always_inline bool __list_del_entry_valid(struct list_head *entry)
>  	return ret;
>  }
>  #else
> -static inline bool __list_add_valid(struct list_head *new,
> -				struct list_head *prev,
> -				struct list_head *next)
> +static inline bool __list_add_valid(struct list_head *new EXT2FS_ATTR((unused)),
> +				struct list_head *prev EXT2FS_ATTR((unused)),
> +				struct list_head *next EXT2FS_ATTR((unused)))
>  {
>  	return true;
>  }
> -static inline bool __list_del_entry_valid(struct list_head *entry)
> +static inline bool __list_del_entry_valid(struct list_head *entry EXT2FS_ATTR((unused)))
>  {
>  	return true;
>  }
> -- 
> 2.53.0
> 
> 

^ permalink raw reply

* Re: [PATCH 7/7] fuse2fs: fix uninitialized variable warnings
From: Darrick J. Wong @ 2026-05-05  0:26 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: Ext4 Developers List
In-Reply-To: <20260504233301.2345652-8-tytso@mit.edu>

On Mon, May 04, 2026 at 07:33:01PM -0400, Theodore Ts'o wrote:
> Clang treats use of unitialized variables found by static analysis to
> be serious enough that it will emit them by default (even without
> -Wall).  So let's fix them up.
> 
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>

I wonder why gcc doesn't complain about this??

Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  fuse4fs/fuse4fs.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/fuse4fs/fuse4fs.c b/fuse4fs/fuse4fs.c
> index b883083f8..928473268 100644
> --- a/fuse4fs/fuse4fs.c
> +++ b/fuse4fs/fuse4fs.c
> @@ -2216,7 +2216,7 @@ static void op_mknod(fuse_req_t req, fuse_ino_t fino, const char *name,
>  	const struct fuse_ctx *ctxt = fuse_req_ctx(req);
>  	struct fuse4fs *ff = fuse4fs_get(req);
>  	ext2_filsys fs;
> -	ext2_ino_t parent, child;
> +	ext2_ino_t parent, child = 0;
>  	errcode_t err;
>  	int filetype;
>  	gid_t gid;
> @@ -2311,7 +2311,7 @@ static void op_mkdir(fuse_req_t req, fuse_ino_t fino, const char *name,
>  	const struct fuse_ctx *ctxt = fuse_req_ctx(req);
>  	struct fuse4fs *ff = fuse4fs_get(req);
>  	ext2_filsys fs;
> -	ext2_ino_t parent, child;
> +	ext2_ino_t parent, child = 0;
>  	errcode_t err;
>  	char *block;
>  	blk64_t blk;
> @@ -2990,7 +2990,7 @@ static void op_symlink(fuse_req_t req, const char *target, fuse_ino_t fino,
>  	const struct fuse_ctx *ctxt = fuse_req_ctx(req);
>  	struct fuse4fs *ff = fuse4fs_get(req);
>  	ext2_filsys fs;
> -	ext2_ino_t parent, child;
> +	ext2_ino_t parent, child = 0;
>  	errcode_t err;
>  	gid_t gid;
>  	int ret = 0;
> @@ -6042,7 +6042,7 @@ static int fuse4fs_main(struct fuse_args *args, struct fuse4fs *ff)
>  	struct fuse_cmdline_opts opts;
>  	struct fuse_session *se;
>  	struct fuse_loop_config *loop_config = NULL;
> -	int ret;
> +	int ret = 0;
>  
>  	if (fuse_parse_cmdline(args, &opts) != 0) {
>  		ret = 1;
> -- 
> 2.53.0
> 
> 

^ permalink raw reply

* Re: [PATCH 0/7] fix up issues from djwong/fuse4fs-fork
From: Theodore Tso @ 2026-05-05  7:21 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Ext4 Developers List
In-Reply-To: <20260505000831.GA1101423@frogsfrogsfrogs>

On Mon, May 04, 2026 at 05:08:31PM -0700, Darrick J. Wong wrote:
> Hm, curious.  It's regrettable that I no longer have a Mac, and
> therefore can't really do much investigating.  If you give
> -o default_permissions,allow_other , does that fix the problem?
> If that fixes it, then fuse2fs has a bug somewhere in its own
> permissions checking.

Nice catch!  Yes, using default_permissions does fix things.  So now I
need to figure out what changed between v1.47.4 and next, and what
default_permissions does.  I notice that in kernel mode we enable
default_permissions?

Can you give me a suggestion at what I might try to look at next?

    	     	  	     	     - Ted




^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox