[CIFS] Fix cifs trying to write to f_ops
authorSteve French <sfrench@us.ibm.com>
Mon, 9 Jan 2006 04:12:58 +0000 (20:12 -0800)
committerSteve French <sfrench@us.ibm.com>
Mon, 9 Jan 2006 04:12:58 +0000 (20:12 -0800)
patch 2ea55c01e0c5dfead8699484b0bae2a375b1f61c fixed CIFS clobbering the
global fops structure for some per mount setting, by duplicating and having
2 fops structs. However the write to the fops was left behind, which is a
NOP in practice (due to the fact that we KNOW the fops has that field set
to NULL already due to the duplication). So remove it... In addition, another
instance of the same bug was forgotten in november.

Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/readdir.c

index 9bdaaecae36f683ef52196b4d54cee256b006029..288cc048d37f1e5b2373c8dd04157bcc90383bcc 100644 (file)
@@ -214,8 +214,7 @@ static void fill_in_inode(struct inode *tmp_inode,
                        tmp_inode->i_fop = &cifs_file_nobrl_ops;
                else
                        tmp_inode->i_fop = &cifs_file_ops;
-               if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
-                       tmp_inode->i_fop->lock = NULL;
+
                tmp_inode->i_data.a_ops = &cifs_addr_ops;
                if((cifs_sb->tcon) && (cifs_sb->tcon->ses) &&
                   (cifs_sb->tcon->ses->server->maxBuf <
@@ -327,12 +326,18 @@ static void unix_fill_in_inode(struct inode *tmp_inode,
        if (S_ISREG(tmp_inode->i_mode)) {
                cFYI(1, ("File inode"));
                tmp_inode->i_op = &cifs_file_inode_ops;
-               if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO)
-                       tmp_inode->i_fop = &cifs_file_direct_ops;
+
+               if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) {
+                       if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
+                               tmp_inode->i_fop = &cifs_file_direct_nobrl_ops;
+                       else
+                               tmp_inode->i_fop = &cifs_file_direct_ops;
+               
+               } else if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
+                       tmp_inode->i_fop = &cifs_file_nobrl_ops;
                else
                        tmp_inode->i_fop = &cifs_file_ops;
-               if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
-                       tmp_inode->i_fop->lock = NULL;
+
                tmp_inode->i_data.a_ops = &cifs_addr_ops;
                if((cifs_sb->tcon) && (cifs_sb->tcon->ses) &&
                   (cifs_sb->tcon->ses->server->maxBuf <