[Devel] [PATCH vz9] ext4/mfsync: do not BUG_ON on wrong set of files
Alexey Kuznetsov
alexey.n.kuznetsov at gmail.com
Mon Dec 4 14:54:06 MSK 2023
Acknowledged!
On Mon, Dec 4, 2023 at 7:36 PM Alexander Atanasov
<alexander.atanasov at virtuozzo.com> wrote:
>
> mfsync(...) can not sync files from different filesystems if
> passed such set of files it BUG_ONs.
> Instead of BUG return -EINVAL.
>
> https://pmc.acronis.work/browse/VSTOR-78331
> Signed-off-by: Alexander Atanasov <alexander.atanasov at virtuozzo.com>
> ---
> fs/ext4/fsync.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c
> index 8179066765bd..933f618f9123 100644
> --- a/fs/ext4/fsync.c
> +++ b/fs/ext4/fsync.c
> @@ -212,7 +212,10 @@ int ext4_sync_files(struct file **files, unsigned int *flags, unsigned int nr_fi
> struct address_space * mapping = files[i]->f_mapping;
> struct inode *inode = mapping->host;
>
> - BUG_ON(sb != inode->i_sb);
> + if (sb != inode->i_sb) {
> + err = -EINVAL;
> + goto out;
> + }
> if (!mapping->nrpages)
> continue;
>
> --
> 2.39.3
>
> _______________________________________________
> Devel mailing list
> Devel at openvz.org
> https://lists.openvz.org/mailman/listinfo/devel
More information about the Devel
mailing list