Re: [PATCH] fs/9p: Initialize status in v9fs_file_do_lock.

2015-01-09 Thread Dominique Martinet
Kirill A. Shutemov wrote on Fri, Jan 09, 2015 at 03:20:51PM +0200:
> > Your patch will not BUG() if status is junk, BUT if status uninitialized
> > value is 0 and p9_client_lock_dotl then we'll return res=0 (success) and
> > not unlock before returning. My patch makes sure we'll return -ENOLCK.
> 
> No, if p9_client_lock_dotl() return 0 it must set status. If it's not,
> that's bug on p9_client_lock_dotl() side and must be fixed.

I had that bit right, but I only remembered your second patch -- sorry.

It should be fine with your patchES, please disregard this one.

-- 
Dominique Martinet,
CEA
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] fs/9p: Initialize status in v9fs_file_do_lock.

2015-01-09 Thread Kirill A. Shutemov
On Fri, Jan 09, 2015 at 02:07:23PM +0100, Dominique Martinet wrote:
> Kirill A. Shutemov wrote on Fri, Jan 09, 2015 at 02:33:53PM +0200:
> > On Fri, Jan 09, 2015 at 12:56:07PM +0100, Dominique Martinet wrote:
> > > If p9_client_lock_dotl returns an error, status is possibly never filled
> > > but will be used in the following switch.
> > > Initializing it to P9_LOCK_ERROR makes sur we will return an error and
> > > cleanup (and not hit the default case).
> > 
> > That's what my patch[1] fixes.
> > 
> > http://marc.info/?i=1419858019-116944-1-git-send-email-kirill.shutemov%40linux.intel.com
> 
> Actually, it's slightly different and still worth adding (mine if we
> apply your's first and your's if we apply mine first - don't think
> they'll conflict. I even reworded the (too old!) commit message to fit
> with your patch :))
> 
> Your patch will not BUG() if status is junk, BUT if status uninitialized
> value is 0 and p9_client_lock_dotl then we'll return res=0 (success) and
> not unlock before returning. My patch makes sure we'll return -ENOLCK.

No, if p9_client_lock_dotl() return 0 it must set status. If it's not,
that's bug on p9_client_lock_dotl() side and must be fixed.

-- 
 Kirill A. Shutemov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] fs/9p: Initialize status in v9fs_file_do_lock.

2015-01-09 Thread Dominique Martinet
Kirill A. Shutemov wrote on Fri, Jan 09, 2015 at 02:33:53PM +0200:
> On Fri, Jan 09, 2015 at 12:56:07PM +0100, Dominique Martinet wrote:
> > If p9_client_lock_dotl returns an error, status is possibly never filled
> > but will be used in the following switch.
> > Initializing it to P9_LOCK_ERROR makes sur we will return an error and
> > cleanup (and not hit the default case).
> 
> That's what my patch[1] fixes.
> 
> http://marc.info/?i=1419858019-116944-1-git-send-email-kirill.shutemov%40linux.intel.com

Actually, it's slightly different and still worth adding (mine if we
apply your's first and your's if we apply mine first - don't think
they'll conflict. I even reworded the (too old!) commit message to fit
with your patch :))

Your patch will not BUG() if status is junk, BUT if status uninitialized
value is 0 and p9_client_lock_dotl then we'll return res=0 (success) and
not unlock before returning. My patch makes sure we'll return -ENOLCK.

Likewise, if we only apply my patch then a rogue server could BUG() a
client, so we want your's anyway.

-- 
Dominique Martinet,
CEA

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] fs/9p: Initialize status in v9fs_file_do_lock.

2015-01-09 Thread Kirill A. Shutemov
On Fri, Jan 09, 2015 at 12:56:07PM +0100, Dominique Martinet wrote:
> If p9_client_lock_dotl returns an error, status is possibly never filled
> but will be used in the following switch.
> Initializing it to P9_LOCK_ERROR makes sur we will return an error and
> cleanup (and not hit the default case).

That's what my patch[1] fixes.

http://marc.info/?i=1419858019-116944-1-git-send-email-kirill.shutemov%40linux.intel.com

-- 
 Kirill A. Shutemov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] fs/9p: Initialize status in v9fs_file_do_lock.

2015-01-09 Thread Dominique Martinet
Kirill A. Shutemov wrote on Fri, Jan 09, 2015 at 02:33:53PM +0200:
 On Fri, Jan 09, 2015 at 12:56:07PM +0100, Dominique Martinet wrote:
  If p9_client_lock_dotl returns an error, status is possibly never filled
  but will be used in the following switch.
  Initializing it to P9_LOCK_ERROR makes sur we will return an error and
  cleanup (and not hit the default case).
 
 That's what my patch[1] fixes.
 
 http://marc.info/?i=1419858019-116944-1-git-send-email-kirill.shutemov%40linux.intel.com

Actually, it's slightly different and still worth adding (mine if we
apply your's first and your's if we apply mine first - don't think
they'll conflict. I even reworded the (too old!) commit message to fit
with your patch :))

Your patch will not BUG() if status is junk, BUT if status uninitialized
value is 0 and p9_client_lock_dotl then we'll return res=0 (success) and
not unlock before returning. My patch makes sure we'll return -ENOLCK.

Likewise, if we only apply my patch then a rogue server could BUG() a
client, so we want your's anyway.

-- 
Dominique Martinet,
CEA

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] fs/9p: Initialize status in v9fs_file_do_lock.

2015-01-09 Thread Kirill A. Shutemov
On Fri, Jan 09, 2015 at 02:07:23PM +0100, Dominique Martinet wrote:
 Kirill A. Shutemov wrote on Fri, Jan 09, 2015 at 02:33:53PM +0200:
  On Fri, Jan 09, 2015 at 12:56:07PM +0100, Dominique Martinet wrote:
   If p9_client_lock_dotl returns an error, status is possibly never filled
   but will be used in the following switch.
   Initializing it to P9_LOCK_ERROR makes sur we will return an error and
   cleanup (and not hit the default case).
  
  That's what my patch[1] fixes.
  
  http://marc.info/?i=1419858019-116944-1-git-send-email-kirill.shutemov%40linux.intel.com
 
 Actually, it's slightly different and still worth adding (mine if we
 apply your's first and your's if we apply mine first - don't think
 they'll conflict. I even reworded the (too old!) commit message to fit
 with your patch :))
 
 Your patch will not BUG() if status is junk, BUT if status uninitialized
 value is 0 and p9_client_lock_dotl then we'll return res=0 (success) and
 not unlock before returning. My patch makes sure we'll return -ENOLCK.

No, if p9_client_lock_dotl() return 0 it must set status. If it's not,
that's bug on p9_client_lock_dotl() side and must be fixed.

-- 
 Kirill A. Shutemov
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] fs/9p: Initialize status in v9fs_file_do_lock.

2015-01-09 Thread Dominique Martinet
Kirill A. Shutemov wrote on Fri, Jan 09, 2015 at 03:20:51PM +0200:
  Your patch will not BUG() if status is junk, BUT if status uninitialized
  value is 0 and p9_client_lock_dotl then we'll return res=0 (success) and
  not unlock before returning. My patch makes sure we'll return -ENOLCK.
 
 No, if p9_client_lock_dotl() return 0 it must set status. If it's not,
 that's bug on p9_client_lock_dotl() side and must be fixed.

I had that bit right, but I only remembered your second patch -- sorry.

It should be fine with your patchES, please disregard this one.

-- 
Dominique Martinet,
CEA
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] fs/9p: Initialize status in v9fs_file_do_lock.

2015-01-09 Thread Kirill A. Shutemov
On Fri, Jan 09, 2015 at 12:56:07PM +0100, Dominique Martinet wrote:
 If p9_client_lock_dotl returns an error, status is possibly never filled
 but will be used in the following switch.
 Initializing it to P9_LOCK_ERROR makes sur we will return an error and
 cleanup (and not hit the default case).

That's what my patch[1] fixes.

http://marc.info/?i=1419858019-116944-1-git-send-email-kirill.shutemov%40linux.intel.com

-- 
 Kirill A. Shutemov
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/