UBIFS: TNC / GC race fixes
[safe/jmp/linux-2.6] / fs / nfs / file.c
index 509dcb5..7846065 100644 (file)
@@ -128,9 +128,7 @@ nfs_file_open(struct inode *inode, struct file *filp)
                return res;
 
        nfs_inc_stats(inode, NFSIOS_VFSOPEN);
-       lock_kernel();
        res = nfs_open(inode, filp);
-       unlock_kernel();
        return res;
 }
 
@@ -180,6 +178,8 @@ force_reval:
 
 static loff_t nfs_file_llseek(struct file *filp, loff_t offset, int origin)
 {
+       loff_t loff;
+
        dprintk("NFS: llseek file(%s/%s, %lld, %d)\n",
                        filp->f_path.dentry->d_parent->d_name.name,
                        filp->f_path.dentry->d_name.name,
@@ -192,7 +192,10 @@ static loff_t nfs_file_llseek(struct file *filp, loff_t offset, int origin)
                if (retval < 0)
                        return (loff_t)retval;
        }
-       return remote_llseek(filp, offset, origin);
+       lock_kernel();  /* BKL needed? */
+       loff = generic_file_llseek_unlocked(filp, offset, origin);
+       unlock_kernel();
+       return loff;
 }
 
 /*
@@ -393,9 +396,7 @@ static int nfs_write_end(struct file *file, struct address_space *mapping,
                        zero_user_segment(page, pglen, PAGE_CACHE_SIZE);
        }
 
-       lock_kernel();
        status = nfs_updatepage(file, page, offset, copied);
-       unlock_kernel();
 
        unlock_page(page);
        page_cache_release(page);