From patchwork Fri May 1 20:16:19 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shirish Pargaonkar X-Patchwork-Id: 21513 Received: from lists.samba.org (mail.samba.org [66.70.73.150]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n41KH19l012780 for ; Fri, 1 May 2009 20:17:02 GMT Received: from dp.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id 2DF5C163C93 for ; Fri, 1 May 2009 20:16:38 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on dp.samba.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.8 tests=AWL,BAYES_00, DNS_FROM_RFC_POST,SPF_PASS autolearn=no version=3.1.7 X-Original-To: linux-cifs-client@lists.samba.org Delivered-To: linux-cifs-client@lists.samba.org Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.242]) by lists.samba.org (Postfix) with ESMTP id E6BDF163BC4 for ; Fri, 1 May 2009 20:15:56 +0000 (GMT) Received: by an-out-0708.google.com with SMTP id c2so1618092anc.35 for ; Fri, 01 May 2009 13:16:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=/4ZMvr2mgBlnIYEq3f/asQGzun2TYfMsvOkjre18WOY=; b=ilCp/JGA/q3HPRblySqH8N/E2W07h49orM4i2g9pHlhcWjxmHNKx34eERZI34TUFWC boc4NBS0fQD6OwY9Z5ahKa0QTJiweyse8MqvZfHM0j+QLgk8waBPvytniypm2lXoI/y1 TIqodmayZ5MEYcivPZ/Ikp5xgV6ZGYuo6UPCc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=pM0KWx7g6xi8npffySAGX48Cm+NwYC+MKYPZOfF2V3iUlHFd0+lOqwBKHqrwBuzmT0 Fqs125IMMjkzReO2xh+xQ7/MM5sPD8Ykh2vegzt1T1/Hao6XsK8MwXY6Kq5tU8Fw46Up 4Os5gaX1dujmlMm/LRSOUKRLQ4b67frp8tdv0= MIME-Version: 1.0 Received: by 10.100.231.16 with SMTP id d16mr6745710anh.63.1241208979771; Fri, 01 May 2009 13:16:19 -0700 (PDT) Date: Fri, 1 May 2009 15:16:19 -0500 Message-ID: <4a4634330905011316o65609395pb05c5676d66783f3@mail.gmail.com> Subject: [patch][linux-cifs-client] fix a regression in cifs caused during lookup intent code patch From: Shirish Pargaonkar To: "linux-cifs-client@lists.samba.org" X-BeenThere: linux-cifs-client@lists.samba.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: The Linux CIFS VFS client List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-cifs-client-bounces+patchwork-cifs-client=patchwork.kernel.org@lists.samba.org Errors-To: linux-cifs-client-bounces+patchwork-cifs-client=patchwork.kernel.org@lists.samba.org Remove adding open file entry twice to lists in case of posix opens Do not fill file info twice in case of posix opens and creates This fixes the regression in cifs which resulted in failure to pass connectathon tests. if (pCifsInode == NULL) { @@ -145,17 +142,6 @@ static inline int cifs_posix_open_inode_helper(struct inode *inode, return -EINVAL; } - /* want handles we can use to read with first - in the list so we do not have to walk the - list to search for one in write_begin */ - if ((file->f_flags & O_ACCMODE) == O_WRONLY) { - list_add_tail(&pCifsFile->flist, - &pCifsInode->openFileList); - } else { - list_add(&pCifsFile->flist, - &pCifsInode->openFileList); - } - if (pCifsInode->clientCanCacheRead) { /* we have the inode open somewhere else no need to discard cache data */ ~ ~ diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 461750e..97f68bd 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c @@ -464,10 +464,8 @@ cifs_create_set_dentry: if ((nd == NULL) || (!(nd->flags & LOOKUP_OPEN))) { /* mknod case - do not leave file open */ CIFSSMBClose(xid, tcon, fileHandle); - } else if (newinode) { - cifs_fill_fileinfo(newinode, fileHandle, - cifs_sb->tcon, write_only); } + cifs_create_out: kfree(buf); kfree(full_path); diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 50ca088..38c06f8 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -129,15 +129,12 @@ static inline int cifs_posix_open_inode_helper(struct inode *inode, struct file *file, struct cifsInodeInfo *pCifsInode, struct cifsFileInfo *pCifsFile, int oplock, u16 netfid) { - struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); -/* struct timespec temp; */ /* BB REMOVEME BB */ file->private_data = kmalloc(sizeof(struct cifsFileInfo), GFP_KERNEL); if (file->private_data == NULL) return -ENOMEM; pCifsFile = cifs_init_private(file->private_data, inode, file, netfid); write_lock(&GlobalSMBSeslock); - list_add(&pCifsFile->tlist, &cifs_sb->tcon->openFileList); pCifsInode = CIFS_I(file->f_path.dentry->d_inode);