lkml.org 
[lkml]   [2009]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] vfs: umount_begin BKL pushdown v2
On Fri, Apr 24, 2009 at 08:13:12AM +0100, Al Viro wrote:
> On Fri, Apr 24, 2009 at 09:06:53AM +0200, Alessio Igor Bogani wrote:
> > static void cifs_umount_begin(struct super_block *sb)
> > {
> > - struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
> > + struct cifs_sb_info *cifs_sb;
> > struct cifsTconInfo *tcon;
> >
> > - if (cifs_sb == NULL)
> > + lock_kernel();
> > + cifs_sb = CIFS_SB(sb);
> > +
> > + if (cifs_sb == NULL) {
> > + unlock_kernel();
> > return;
> > + }
> >
> > tcon = cifs_sb->tcon;
> > - if (tcon == NULL)
> > + if (tcon == NULL) {
> > + unlock_kernel();
> > return;
> > + }
>
> AFAICS, both CIFS_SB(sb) and ->tcon are assign-once, so lock_kernel() should
> really go here (if it can't be removed completely, of course, but that's up
> to CIFS folks). Applied with such modification.

PS: I suspect that checks for NULL are actually "what if kernel memory got
corrupted", but I'm too lazy to verify that at the moment; again, up to
CIFS folks.


\
 
 \ /
  Last update: 2009-04-24 09:19    [W:0.659 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site