Return-Path: Received: from us-smtp-delivery-194.mimecast.com ([63.128.21.194]:46338 "EHLO us-smtp-delivery-194.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752038AbcFQOBs (ORCPT ); Fri, 17 Jun 2016 10:01:48 -0400 From: Trond Myklebust To: Oleg Drokin CC: "linux-nfs@vger.kernel.org" Subject: Re: [PATCH 03/12] NFS: Cache aggressively when file is open for writing Date: Fri, 17 Jun 2016 14:01:18 +0000 Message-ID: References: <1465931115-30784-1-git-send-email-trond.myklebust@primarydata.com> <1465931115-30784-2-git-send-email-trond.myklebust@primarydata.com> <1465931115-30784-3-git-send-email-trond.myklebust@primarydata.com> <87A9597E-A1F5-4DBE-B3C1-12369E5DF994@linuxhacker.ru> In-Reply-To: <87A9597E-A1F5-4DBE-B3C1-12369E5DF994@linuxhacker.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-nfs-owner@vger.kernel.org List-ID: DQoNCk9uIDYvMTYvMTYsIDIxOjExLCAiT2xlZyBEcm9raW4iIDxncmVlbkBsaW51eGhhY2tlci5y dT4gd3JvdGU6DQoNCkkgZ2V0IGFsbW9zdC1pbnN0YS1jcmFzaCB3aXRoIHRoaXMgcGF0Y2ggKHJl YWxseSwganVzdCB0ZXN0aW5nDQp0aGUgdGVzdGluZyBicmFuY2gsIGJ1dCBpbiB0aGUgY29kZSB0 aGlzIHBhdGNoIGludHJvZHVjZWQpLg0KLXJjMiBkaWQgbm90IGhhdmUgdGhpcyBzb3J0IG9mIGNy YXNoLCBzbyBpdCBtdXN0IGJlIGEgbmV3IG9uZS4NCg0KT24gSnVuIDE0LCAyMDE2LCBhdCAzOjA1 IFBNLCBUcm9uZCBNeWtsZWJ1c3Qgd3JvdGU6DQoNCj4gVW5sZXNzIHRoZSB1c2VyIGlzIHVzaW5n IGZpbGUgbG9ja2luZywgd2UgbXVzdCBhc3N1bWUgY2xvc2UtdG8tb3Blbg0KPiBjYWNoZSBjb25z aXN0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