From patchwork Tue Jan 8 20:57:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Herton Ronaldo Krzesinski X-Patchwork-Id: 210519 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id CF9F22C007E for ; Wed, 9 Jan 2013 07:58:12 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TsgFH-0000f9-Is; Tue, 08 Jan 2013 20:58:03 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TsgFB-0000bW-78 for kernel-team@lists.ubuntu.com; Tue, 08 Jan 2013 20:57:57 +0000 Received: from 189.58.23.196.dynamic.adsl.gvt.net.br ([189.58.23.196] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1TsgF8-00047D-Ve; Tue, 08 Jan 2013 20:57:55 +0000 From: Herton Ronaldo Krzesinski To: Jeff Layton Subject: =?UTF-8?q?=5B=203=2E5=2Ey=2Ez=20extended=20stable=20=5D=20Patch=20=22cifs=3A=20don=27t=20compare=20uniqueids=20in=20cifs=5Fprime=5Fdcache=22=20has=20been=20added=20to=20staging=20queue?= Date: Tue, 8 Jan 2013 18:57:51 -0200 Message-Id: <1357678671-20426-1-git-send-email-herton.krzesinski@canonical.com> X-Mailer: git-send-email 1.7.9.5 X-Extended-Stable: 3.5 MIME-Version: 1.0 Cc: Steve French , kernel-team@lists.ubuntu.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com This is a note to let you know that I have just added a patch titled cifs: don't compare uniqueids in cifs_prime_dcache to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree which can be found at: http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue If you, or anyone else, feels it should not be added to this tree, please reply to this email. For more information about the 3.5.y.z tree, see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable Thanks. -Herton ------ From 3f0b0cbd46d9dc4d26cb715c8ccee60374448236 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Tue, 18 Dec 2012 06:35:10 -0500 Subject: [PATCH 20/27] cifs: don't compare uniqueids in cifs_prime_dcache unless server inode numbers are in use MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 2f2591a34db6c9361faa316c91a6e320cb4e6aee upstream. Oliver reported that commit cd60042c caused his cifs mounts to continually thrash through new inodes on readdir. His servers are not sending inode numbers (or he's not using them), and the new test in that function doesn't account for that sort of setup correctly. If we're not using server inode numbers, then assume that the inode attached to the dentry hasn't changed. Go ahead and update the attributes in place, but keep the same inode number. Reported-and-Tested-by: Oliver Mössinger Signed-off-by: Jeff Layton Signed-off-by: Steve French [ herton: function was still named cifs_readdir_lookup on 3.5, adjusted to also return dentry ] Signed-off-by: Herton Ronaldo Krzesinski --- fs/cifs/readdir.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) -- 1.7.9.5 diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c index a4217f0..6cb83b9 100644 --- a/fs/cifs/readdir.c +++ b/fs/cifs/readdir.c @@ -76,6 +76,7 @@ cifs_readdir_lookup(struct dentry *parent, struct qstr *name, struct dentry *dentry, *alias; struct inode *inode; struct super_block *sb = parent->d_inode->i_sb; + struct cifs_sb_info *cifs_sb = CIFS_SB(sb); cFYI(1, "For %s", name->name); @@ -87,10 +88,20 @@ cifs_readdir_lookup(struct dentry *parent, struct qstr *name, dentry = d_lookup(parent, name); if (dentry) { inode = dentry->d_inode; - /* update inode in place if i_ino didn't change */ - if (inode && CIFS_I(inode)->uniqueid == fattr->cf_uniqueid) { - cifs_fattr_to_inode(inode, fattr); - return dentry; + if (inode) { + /* + * If we're generating inode numbers, then we don't + * want to clobber the existing one with the one that + * the readdir code created. + */ + if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM)) + fattr->cf_uniqueid = CIFS_I(inode)->uniqueid; + + /* update inode in place if i_ino didn't change */ + if (CIFS_I(inode)->uniqueid == fattr->cf_uniqueid) { + cifs_fattr_to_inode(inode, fattr); + return dentry; + } } d_drop(dentry); dput(dentry);