Message ID | 20190814121834.13983-3-s.hauer@pengutronix.de |
---|---|
State | Changes Requested |
Headers | show |
Series | Add quota support to UBIFS | expand |
On Wed 14-08-19 14:18:25, Sascha Hauer wrote: > For filesystems which do not have a quota_format_type such as upcoming > UBIFS quota fmt may be NULL. Only put the format when it's non NULL. > > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> But you do have quota format in the end. So is this patch needed? Honza > --- > fs/quota/dquot.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c > index 3cb836351c22..b043468e53f2 100644 > --- a/fs/quota/dquot.c > +++ b/fs/quota/dquot.c > @@ -218,6 +218,9 @@ static struct quota_format_type *find_quota_format(int id) > > static void put_quota_format(struct quota_format_type *fmt) > { > + if (!fmt) > + return; > + > module_put(fmt->qf_owner); > } > > -- > 2.20.1 > >
On Thu, Aug 15, 2019 at 01:18:00PM +0200, Jan Kara wrote: > On Wed 14-08-19 14:18:25, Sascha Hauer wrote: > > For filesystems which do not have a quota_format_type such as upcoming > > UBIFS quota fmt may be NULL. Only put the format when it's non NULL. > > > > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> > > But you do have quota format in the end. So is this patch needed? I have quota_format_ops, but as I do not store any quota data I do not have a quota_format_type. Yes, this patch is needed. Sascha
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 3cb836351c22..b043468e53f2 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -218,6 +218,9 @@ static struct quota_format_type *find_quota_format(int id) static void put_quota_format(struct quota_format_type *fmt) { + if (!fmt) + return; + module_put(fmt->qf_owner); }
For filesystems which do not have a quota_format_type such as upcoming UBIFS quota fmt may be NULL. Only put the format when it's non NULL. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> --- fs/quota/dquot.c | 3 +++ 1 file changed, 3 insertions(+)