Return-Path: Received: from mail-bl2nam02on0127.outbound.protection.outlook.com ([104.47.38.127]:20944 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726761AbeIKR4V (ORCPT ); Tue, 11 Sep 2018 13:56:21 -0400 From: Trond Myklebust To: "kinglongmee@gmail.com" , "devel@lists.nfs-ganesha.org" , "linux-nfs@vger.kernel.org" Subject: Re: lseek gets bad offset from nfs client with ganesha/gluster which supports SEEK Date: Tue, 11 Sep 2018 12:57:01 +0000 Message-ID: <182a9c6a29690fc00789768bdfe03affbac0db9e.camel@hammerspace.com> References: <182fecd3-66c3-0cbd-fbc0-cf1a88b7f165@gmail.com> In-Reply-To: <182fecd3-66c3-0cbd-fbc0-cf1a88b7f165@gmail.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org List-ID: T24gVHVlLCAyMDE4LTA5LTExIGF0IDIwOjI5ICswODAwLCBLaW5nbG9uZyBNZWUgd3JvdGU6DQo+ IFRoZSBsYXRlc3QgZ2FuZXNoYS9nbHVzdGVyIHN1cHBvcnRzIHNlZWsgYWNjb3JkaW5nIHRvLA0K PiANCj4gDQpodHRwczovL3Rvb2xzLmlldGYub3JnL2h0bWwvZHJhZnQtaWV0Zi1uZnN2NC1taW5v cnZlcnNpb24yLTQxI3NlY3Rpb24tMTUuMTENCj4gDQo+ICAgIEZyb20gdGhlIGdpdmVuIHNhX29m ZnNldCwgZmluZCB0aGUgbmV4dCBkYXRhX2NvbnRlbnQ0IG9mIHR5cGUNCj4gc2Ffd2hhdA0KPiAg ICBpbiB0aGUgZmlsZS4gIElmIHRoZSBzZXJ2ZXIgY2FuIG5vdCBmaW5kIGEgY29ycmVzcG9uZGlu ZyBzYV93aGF0LA0KPiAgICB0aGVuIHRoZSBzdGF0dXMgd2lsbCBzdGlsbCBiZSBORlM0X09LLCBi dXQgc3JfZW9mIHdvdWxkIGJlDQo+IFRS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