Re: [PATCH 2/5 -tip] cifs: umount_begin BKL pushdown

Matthew Wilcox
2009-04-23T19:19:51Z

On Thu, Apr 23, 2009 at 09:12:02PM +0200, Alessio Igor Bogani wrote:
> @@ -525,18 +526,26 @@ static void cifs_umount_begin(struct super_block *sb)
> struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
> struct cifsTconInfo *tcon;
>
> - if (cifs_sb == NULL)
> + lock_kernel();
> +
> + if (cifs_sb == NULL) {
> + unlock_kernel();
> return;

OK, what are you doing here? Either the BKL protects the sb here,
and you need to lock_kernel() before calling CIFS_SB(sb), or the BKL
protects nothing, and the lock_kernel() should be moved down below the
test for cifs_sb.

> + }
>
> tcon = cifs_sb->tcon;
> - if (tcon == NULL)
> + if (tcon == NULL) {
> + unlock_kernel();
> return;
> + }

Likewise -- does cifs rely on the BKL to protect the 'tcon' or not?

--
Matthew Wilcox Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."