[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAFj5m9+FGzRV+fsWtsVSHV4JFh9Pit-KFHiKRWtMKBpM9LWBhQ@mail.gmail.com>
Date: Mon, 29 Sep 2025 23:01:50 +0800
From: Ming Lei <ming.lei@...hat.com>
To: Li Chen <me@...ux.beauty>
Cc: Markus Elfring <Markus.Elfring@....de>, Li Chen <chenl311@...natelecom.cn>,
linux-block <linux-block@...r.kernel.org>, Jens Axboe <axboe@...nel.dk>,
LKML <linux-kernel@...r.kernel.org>, Yang Erkun <yangerkun@...wei.com>
Subject: Re: [PATCH] loop: fix backing file reference leak on validation error
On Mon, Sep 29, 2025 at 8:54 PM Li Chen <me@...ux.beauty> wrote:
>
> Hi Markus,
>
> ---- On Sun, 28 Sep 2025 21:48:23 +0800 Markus Elfring <Markus.Elfring@....de> wrote ---
> > …
> > > Fix this by calling fput(file) before returning the error.
> > …
> > > +++ b/drivers/block/loop.c
> > …
> >
> > How do you think about to increase the application of scope-based resource management?
> > https://elixir.bootlin.com/linux/v6.17-rc7/source/include/linux/file.h#L97
>
> Looks good; I will add a commit to switch to scope-based resource management in v2.
> Thanks for your suggestion!
Please don't do it as one bug fix, the whole fix chain needs to
backport, and scope-based
fput is just added in v6.15.
However, you can do it as one cleanup after the fix is merged.
Thanks,
Powered by blists - more mailing lists