From patchwork Fri Nov 19 11:55:57 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 339161 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 oAJBtxWs025026 for ; Fri, 19 Nov 2010 11:56:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753790Ab0KSLz7 (ORCPT ); Fri, 19 Nov 2010 06:55:59 -0500 Received: from mail-ww0-f44.google.com ([74.125.82.44]:54167 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753733Ab0KSLz7 convert rfc822-to-8bit (ORCPT ); Fri, 19 Nov 2010 06:55:59 -0500 Received: by wwa36 with SMTP id 36so4530806wwa.1 for ; Fri, 19 Nov 2010 03:55:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=BKxFAGgcbOrEfOWJeyJoqgrZGf3ADmg3IOtVItT1jWA=; b=dQLp01xKp4Aa7IopFUGbCDa6yfVBovRnVSLjANy0xJdHVwutrI0W9/8QEwhYsdpGcH fLoHw6iNyQH5wRFu1CQEGGK2SAfwitwAOdz9iaXe3wgJbFgCX8YryQmp16zwthhdojIm lDWxoRk0cYsSUESRx8qAmz9Zt/rCr1D4pyQec= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=jRMXyCmwU8u8talqsTUjh4yA7eMUfY4+8iGU/OEmI1PeEo8M+ErydifSbj8OGW/5Ra 9IX3Tm7Dz1HrwffmDC2kvDhhYMaR9nGMbozPHdOFPL/8buANKrqZEq0i6lXkiResWDJc yoU/uAe+TDR6ObGuorxKpi2mmXr7Vuwd2QHUY= MIME-Version: 1.0 Received: by 10.216.132.131 with SMTP id o3mr1767376wei.19.1290167757452; Fri, 19 Nov 2010 03:55:57 -0800 (PST) Received: by 10.216.18.193 with HTTP; Fri, 19 Nov 2010 03:55:57 -0800 (PST) In-Reply-To: References: <1289459222-8210-1-git-send-email-piastryyy@gmail.com> <20101115073430.2254b19c@tlielax.poochiereds.net> Date: Fri, 19 Nov 2010 14:55:57 +0300 Message-ID: Subject: Re: [PATCH 1/6] CIFS: Make cifsFileInfo_put work with strict cache mode From: Pavel Shilovsky To: Jeff Layton , Steve French Cc: 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]); Fri, 19 Nov 2010 11:56:00 +0000 (UTC) diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index ff7d299..66d3ba3 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -1679,12 +1679,16 @@ cifs_invalidate_mapping(struct inode *inode) cifs_i->invalid_mapping = false; - /* write back any cached data */ - if (inode->i_mapping && inode->i_mapping->nrpages != 0) { - rc = filemap_write_and_wait(inode->i_mapping); - mapping_set_error(inode->i_mapping, rc); + if (inode->i_mapping) { + /* write back any cached data */ + if (inode->i_mapping->nrpages != 0) { + rc = filemap_write_and_wait(inode->i_mapping); + mapping_set_error(inode->i_mapping, rc); + } + + invalidate_inode_pages2(inode->i_mapping); } - invalidate_remote_inode(inode); + cifs_fscache_reset_inode_cookie(inode); }