Re: [PATCH] staging: lustre: fix sparse warnings related to lock context imbalance

2015-01-21 Thread Loïc Pefferkorn
On Sat, Jan 17, 2015 at 03:29:01PM -0800, Greg KH wrote: > On Sat, Dec 13, 2014 at 03:58:46PM +0100, Loïc Pefferkorn wrote: > > > >>> Don't hide "implementation of locks" in functions like this, it only > > > >>> causes problems. This code has layers of layers of layers of > > > >>> abstractions d

Re: [PATCH] staging: lustre: fix sparse warnings related to lock context imbalance

2015-01-17 Thread Greg KH
On Sat, Dec 13, 2014 at 03:58:46PM +0100, Loïc Pefferkorn wrote: > > >>> Don't hide "implementation of locks" in functions like this, it only > > >>> causes problems. This code has layers of layers of layers of > > >>> abstractions due to it wanting to be originally ported to other > > >>> operati

Re: [PATCH] staging: lustre: fix sparse warnings related to lock context imbalance

2014-12-13 Thread Loïc Pefferkorn
> >>> Don't hide "implementation of locks" in functions like this, it only > >>> causes problems. This code has layers of layers of layers of > >>> abstractions due to it wanting to be originally ported to other > >>> operating systems and lots of different kernel versions of Linux itself. > >>> U

Re: [PATCH] staging: lustre: fix sparse warnings related to lock context imbalance

2014-12-07 Thread Andreas Dilger
On Dec 7, 2014, at 4:57 AM, Loïc Pefferkorn wrote: > > On Tue, Dec 02, 2014 at 02:11:33PM -0700, Andreas Dilger wrote: >> On Nov 28, 2014, at 11:50 AM, Greg KH wrote: >>> On Thu, Nov 27, 2014 at 07:34:10PM +0100, Loïc Pefferkorn wrote: Hello Greg, After some investigation, I thin

Re: [PATCH] staging: lustre: fix sparse warnings related to lock context imbalance

2014-12-07 Thread Loïc Pefferkorn
On Tue, Dec 02, 2014 at 02:11:33PM -0700, Andreas Dilger wrote: > On Nov 28, 2014, at 11:50 AM, Greg KH wrote: > > On Thu, Nov 27, 2014 at 07:34:10PM +0100, Loïc Pefferkorn wrote: > >> Hello Greg, > >> > >> After some investigation, I think that removing these wrappers is not > >> going to impro

Re: [PATCH] staging: lustre: fix sparse warnings related to lock context imbalance

2014-12-02 Thread Andreas Dilger
On Nov 28, 2014, at 11:50 AM, Greg KH wrote: > On Thu, Nov 27, 2014 at 07:34:10PM +0100, Loïc Pefferkorn wrote: >> Hello Greg, >> >> After some investigation, I think that removing these wrappers is not going >> to improve the code readability: >> >> On Wed, Nov 26, 2014 at 12:54:43PM -0800, Gr

Re: [PATCH] staging: lustre: fix sparse warnings related to lock context imbalance

2014-11-30 Thread Loïc Pefferkorn
On Fri, Nov 28, 2014 at 02:22:07PM -0800, Greg KH wrote: > > That's even worse than I imagined. Putting sparse markings on these > function calls is just papering over nonsense. Please work on unwinding > the mess so that you don't need callbacks for locks, that is an > abstraction that isn't ne

Re: [PATCH] staging: lustre: fix sparse warnings related to lock context imbalance

2014-11-28 Thread Greg KH
On Thu, Nov 27, 2014 at 07:34:10PM +0100, Loïc Pefferkorn wrote: > Hello Greg, > > After some investigation, I think that removing these wrappers is not going > to improve the code readability: > > On Wed, Nov 26, 2014 at 12:54:43PM -0800, Greg KH wrote: > > On Wed, Nov 26, 2014 at 05:15:48PM +0

Re: [PATCH] staging: lustre: fix sparse warnings related to lock context imbalance

2014-11-28 Thread Dan Carpenter
On Thu, Nov 27, 2014 at 07:34:10PM +0100, Loïc Pefferkorn wrote: > 1827 if (valid != 0) { > 1828 cl_object_attr_lock(obj); > 1829 cl_object_attr_set(env, obj, attr, valid); > 1830 cl_object_attr_unlock(obj); > > after: > > 1827 if (valid != 0) {

Re: [PATCH] staging: lustre: fix sparse warnings related to lock context imbalance

2014-11-27 Thread Loïc Pefferkorn
Hello Greg, After some investigation, I think that removing these wrappers is not going to improve the code readability: On Wed, Nov 26, 2014 at 12:54:43PM -0800, Greg KH wrote: > On Wed, Nov 26, 2014 at 05:15:48PM +0100, Loic Pefferkorn wrote: > > Add __acquires() and __releases() function anno

Re: [PATCH] staging: lustre: fix sparse warnings related to lock context imbalance

2014-11-26 Thread Loïc Pefferkorn
On Wed, Nov 26, 2014 at 12:54:43PM -0800, Greg KH wrote: > > Ugh, how horrid, please just delete these functions and push down the > spin_lock/unlock calls down into the places these are called. > > Same for these. > > Same thing here. Hello Greg, Thanks for your comments, I will write a v2. -

Re: [PATCH] staging: lustre: fix sparse warnings related to lock context imbalance

2014-11-26 Thread Greg KH
On Wed, Nov 26, 2014 at 05:15:48PM +0100, Loic Pefferkorn wrote: > Add __acquires() and __releases() function annotations, to fix sparse > warnings related to lock context imbalance. > > This fixes the following warnings: > > drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c:153:5: wa