Re: [PATCH 4/5] fs: make FSCONFIG_CMD_RECONFIGURE killable on s_umount

From: Jan Kara

Date: Mon Oct 26 2026 - 08:41:31 EST


On Fri 23-10-26 20:39:33, Josef Bacik wrote:
> fsconfig(2) with FSCONFIG_CMD_RECONFIGURE is the remount of the new mount
> API, and like mount(2) with MS_REMOUNT it waits for s_umount in D state,
> can't be killed, and keeps every later reader of the lock waiting behind
> it.
>
> Use down_write_killable(). A wait which is cut short is treated like any
> other failure to reconfigure, the context ends up in FS_CONTEXT_FAILED.
>
> Signed-off-by: Josef Bacik <josef@xxxxxxxxxxxxxx>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@xxxxxxx>

Honza

> ---
> fs/fsopen.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/fs/fsopen.c b/fs/fsopen.c
> index 70024870fefa..c139cec2f1fe 100644
> --- a/fs/fsopen.c
> +++ b/fs/fsopen.c
> @@ -267,9 +267,11 @@ static int vfs_cmd_reconfigure(struct fs_context *fc)
> return -EPERM;
> }
>
> - down_write(&sb->s_umount);
> - ret = reconfigure_super(fc);
> - up_write(&sb->s_umount);
> + ret = down_write_killable(&sb->s_umount);
> + if (!ret) {
> + ret = reconfigure_super(fc);
> + up_write(&sb->s_umount);
> + }
> if (ret) {
> fc->phase = FS_CONTEXT_FAILED;
> return ret;
>
> --
> 2.55.0
>
--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR