Re: [PATCH] xfs: inode lockdep annotations broke non-lockdep build

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> > 
> > 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@xxxxxxxxxx>
> > ---
> >  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@xxxxxxxxxxxxx

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs




[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux