[PATCH v2 0/2] fsconfig: minor fsparam_fd fixes

Aleksa Sarai posted 2 patches 1 year, 4 months ago
fs/autofs/inode.c |  3 +--
fs/coda/inode.c   | 43 ++++++++++++++++++++++++++++++-------------
2 files changed, 31 insertions(+), 15 deletions(-)
[PATCH v2 0/2] fsconfig: minor fsparam_fd fixes
Posted by Aleksa Sarai 1 year, 4 months ago
While working on adding an fsparam_fd() argument to cgroupfs, I noticed
that there are only two users of fsparam_fd() and they both seemed to
have minor issues:

* autofs has a missing fput() when using FSCONFIG_SET_FD.
* coda uses fsparam_fd() but it ignores param->file and so ends up
  re-getting the file. This doesn't change the behaviour but it seems
  preferable to have all users of fsparam_fd() have the same logic.

I have tested this logic for the cgroupfs patch but I have only compile
tested the fixes for autofs and coda.

The second patch is not really required, so feel free to drop it if you
feel the original version was cleaner.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
---
Changes in v2:
- Fix fs/coda/inode.c build errors.
- Link to v1: https://lore.kernel.org/r/20240719-fsconfig-fsparam_fd-fixes-v1-0-7ccd315c2ad4@cyphar.com

---
Aleksa Sarai (2):
      autofs: fix missing fput for FSCONFIG_SET_FD
      coda: use param->file for FSCONFIG_SET_FD

 fs/autofs/inode.c |  3 +--
 fs/coda/inode.c   | 43 ++++++++++++++++++++++++++++++-------------
 2 files changed, 31 insertions(+), 15 deletions(-)
---
base-commit: c7b9563b58a77423d4c6e026ff831a69612b02fc
change-id: 20240714-fsconfig-fsparam_fd-fixes-09f2e741c28d

Best regards,
-- 
Aleksa Sarai <cyphar@cyphar.com>
Re: [PATCH v2 0/2] fsconfig: minor fsparam_fd fixes
Posted by Christian Brauner 1 year, 4 months ago
On Wed, 31 Jul 2024 23:10:26 +1000, Aleksa Sarai wrote:
> While working on adding an fsparam_fd() argument to cgroupfs, I noticed
> that there are only two users of fsparam_fd() and they both seemed to
> have minor issues:
> 
> * autofs has a missing fput() when using FSCONFIG_SET_FD.
> * coda uses fsparam_fd() but it ignores param->file and so ends up
>   re-getting the file. This doesn't change the behaviour but it seems
>   preferable to have all users of fsparam_fd() have the same logic.
> 
> [...]

Applied to the vfs.misc branch of the vfs/vfs.git tree.
Patches in the vfs.misc branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.misc

[1/2] autofs: fix missing fput for FSCONFIG_SET_FD
      https://git.kernel.org/vfs/vfs/c/9f6b314ecc8b
[2/2] coda: use param->file for FSCONFIG_SET_FD
      https://git.kernel.org/vfs/vfs/c/b0839e9bbc5b