From patchwork Sat Sep 18 06:37:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 189582 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8I6buDv030945 for ; Sat, 18 Sep 2010 06:37:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751920Ab0IRGhy (ORCPT ); Sat, 18 Sep 2010 02:37:54 -0400 Received: from mail-iw0-f174.google.com ([209.85.214.174]:32952 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751275Ab0IRGhy (ORCPT ); Sat, 18 Sep 2010 02:37:54 -0400 Received: by iwn5 with SMTP id 5so2564943iwn.19 for ; Fri, 17 Sep 2010 23:37:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=XB7F98sTbPc72rTvscTnU/QyW3TevRQsqV/E+ng5tQg=; b=K91/yOaITv3NyR8Gd46pEbw/7DjHbPKMCLUjndxRFuaEdlbL4d7hKBkmUlBdWHjKy8 d+ug3t2ShAQihRdfIQwR4kViFfnUI+oscgyYNFjZOnF61g/a9KHYsuA45yNHNierPtin BNlJ6F0wl8Dk1YGCHKgTx34Z57Lm/WmyP5ZPs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=mQEzzienwgk+QE2cwB7kS0q47bpA6PvgMTbmFyleqFTtvV3T4frqtAA5genHFuNkCT A0FwgKGNf6HVtYqKIt9adl1o/877qPuB/9GfPTlDA6uv6KFEfc0uNPC6WCyTsaLunB7U oyqgDQhE1lfB0hTTjy+R34n3N1zoUDTwKTUs8= MIME-Version: 1.0 Received: by 10.231.161.16 with SMTP id p16mr6420588ibx.61.1284791873856; Fri, 17 Sep 2010 23:37:53 -0700 (PDT) Received: by 10.231.171.205 with HTTP; Fri, 17 Sep 2010 23:37:53 -0700 (PDT) Date: Sat, 18 Sep 2010 10:37:53 +0400 Message-ID: Subject: [PATCH] CIFS: Invaldate remote inode on the last close From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sat, 18 Sep 2010 06:37:56 +0000 (UTC) diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 60061b9..babe574 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -211,8 +211,14 @@ client_can_cache: pCifsInode->clientCanCacheAll = true; pCifsInode->clientCanCacheRead = true; cFYI(1, "Exclusive Oplock granted on inode %p", inode); - } else if ((oplock & 0xF) == OPLOCK_READ) + } else if ((oplock & 0xF) == OPLOCK_READ) { + pCifsInode->clientCanCacheAll = false; pCifsInode->clientCanCacheRead = true; + cFYI(1, "Level II Oplock franted on inode %p", inode); + } else { + pCifsInode->clientCanCacheAll = false; + pCifsInode->clientCanCacheRead = false; + } return rc; } @@ -633,6 +639,7 @@ int cifs_close(struct inode *inode, struct file *file) on this inode, much less write behind and read ahead */ CIFS_I(inode)->clientCanCacheRead = false; CIFS_I(inode)->clientCanCacheAll = false; + invalidate_remote_inode(inode); } read_unlock(&GlobalSMBSeslock); if ((rc == 0) && CIFS_I(inode)->write_behind_rc)