[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250116043226.GA23137@lst.de>
Date: Thu, 16 Jan 2025 05:32:26 +0100
From: Christoph Hellwig <hch@....de>
To: Andreas Gruenbacher <agruenba@...hat.com>
Cc: Christoph Hellwig <hch@....de>,
Andrew Morton <akpm@...ux-foundation.org>,
Al Viro <viro@...iv.linux.org.uk>,
Christian Brauner <brauner@...nel.org>,
Gao Xiang <xiang@...nel.org>, Chao Yu <chao@...nel.org>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-erofs@...ts.ozlabs.org, gfs2@...ts.linux.dev
Subject: Re: [PATCH 8/8] gfs2: use lockref_init for qd_lockref
On Wed, Jan 15, 2025 at 02:35:03PM +0100, Andreas Gruenbacher wrote:
> > +++ b/fs/gfs2/quota.c
> > @@ -236,8 +236,7 @@ static struct gfs2_quota_data *qd_alloc(unsigned hash, struct gfs2_sbd *sdp, str
> > return NULL;
> >
> > qd->qd_sbd = sdp;
> > - qd->qd_lockref.count = 0;
> > - spin_lock_init(&qd->qd_lockref.lock);
> > + lockref_init(&qd->qd_lockref, 0);
>
> Hmm, initializing count to 0 seems to be the odd case and it's fairly
> simple to change gfs2 to work with an initial value of 1. I wonder if
> lockref_init() should really have a count argument.
Well, if you can fix it to start with 1 we could start out with 1
as the default. FYI, I also didn't touch the other gfs2 lockref
because it initialize the lock in the slab init_once callback and
the count on every initialization.
Powered by blists - more mailing lists