From: Dave Chinner <david@fromorbit.com>
To: Brian Foster <bfoster@redhat.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH] xfs: inode lockdep annotations broke non-lockdep build
Date: Fri, 21 Aug 2015 10:42:54 +1000 [thread overview]
Message-ID: <20150821004254.GV714@dastard> (raw)
In-Reply-To: <20150820113200.GA13033@bfoster.bfoster>
On Thu, Aug 20, 2015 at 07:32:00AM -0400, Brian Foster wrote:
> On Wed, Aug 19, 2015 at 08:23:34PM +1000, Dave Chinner wrote:
> > From: Dave Chinner <dchinner@redhat.com>
> >
> > Fix CONFIG_LOCKDEP=n build, because asserts I put in to ensure we
> > aren't overrunning lockdep subclasses in commit 0952c81 ("xfs:
> > clean up inode lockdep annotations") use a define that doesn't
> > exist when CONFIG_LOCKDEP=n
> >
> > Only check the subclass limits when lockdep is actually enabled.
> >
> > Signed-off-by: Dave Chinner <dchinner@redhat.com>
> > ---
> > fs/xfs/xfs_inode.c | 16 ++++++++++++++--
> > 1 file changed, 14 insertions(+), 2 deletions(-)
> >
> > diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
> > index dd584da..30555f8 100644
> > --- a/fs/xfs/xfs_inode.c
> > +++ b/fs/xfs/xfs_inode.c
> > @@ -362,6 +362,17 @@ int xfs_lots_retries;
> > int xfs_lock_delays;
> > #endif
> >
> > +#ifdef CONFIG_LOCKDEP
> > +static bool
> > +xfs_lockdep_subclass_ok(
> > + int subclass)
> > +{
> > + return subclass < MAX_LOCKDEP_SUBCLASSES;
> > +}
> > +#else
> > +#define xfs_lockdep_subclass_ok(subclass) (true)
> > +#endif
> > +
>
> FYI, there's a compile warning with debug and verbose warnings disabled:
>
> ...
> CC [M] fs/xfs//xfs_super.o
> fs/xfs//xfs_inode.c:367:1: warning: ‘xfs_lockdep_subclass_ok’ defined but not used [-Wunused-function]
> xfs_lockdep_subclass_ok(
> ^
> ...
Yeah, I know. I've got another patch to fix that. I didn't test all
6 different combinations of the relevant config parameters before
pushing the change. (I turned off CONFIG_XFS_DEBUG, but turned on
CONFIG_XFS_WARN, so the function was still used).
I haven't pushed it yet, becuse it's just a useless warning rather
than a full build breakage and there's been other stuff I've needed
to deal with.
(I don't work at all efficiently when I have to context switch
all the time. And there's so many things I nee dto pay attention to
that I'm context switching every few minutes...)
> Perhaps it's best to just use the #define in both cases?
-#ifdef CONFIG_LOCKDEP
+#if (defined(DEBUG) || defined(XFS_WARN)) && CONFIG_LOCKDEP
is how I fixed it.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2015-08-21 0:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-19 10:23 [PATCH] xfs: inode lockdep annotations broke non-lockdep build Dave Chinner
2015-08-19 22:50 ` Eric Sandeen
2015-08-20 11:32 ` Brian Foster
2015-08-21 0:42 ` Dave Chinner [this message]
2015-08-21 11:09 ` Brian Foster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150821004254.GV714@dastard \
--to=david@fromorbit.com \
--cc=bfoster@redhat.com \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.