Received: from eggs.gnu.org ([2001:4830:134:3::10]:45785) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWaxH-0001Mu-RI for qemu-devel@nongnu.org; Mon, 31 Aug 2015 22:05:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWaxE-0002jD-Lq for qemu-devel@nongnu.org; Mon, 31 Aug 2015 22:05:47 -0400 Received: from mail-io0-x236.google.com ([2607:f8b0:4001:c06::236]:35206) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWaxE-0002ii-GJ for qemu-devel@nongnu.org; Mon, 31 Aug 2015 22:05:44 -0400 Received: by iog7 with SMTP id 7so56053160iog.2 for ; Mon, 31 Aug 2015 19:05:44 -0700 (PDT) Date: Tue, 1 Sep 2015 10:05:38 +0800 From: Liu Yuan Message-ID: <20150901020538.GB11585@ubuntu-trusty> References: <1441070971-22535-1-git-send-email-namei.unix@gmail.com> <20150901015100.GI31272@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150901015100.GI31272@localhost.localdomain> Subject: Re: [Qemu-devel] [PATCH] sheepdog: discard the payload if the header is invalid List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jeff Cody Cc: Kevin Wolf , sheepdog-ng@googlegroups.com, Stefan Hajnoczi , qemu-devel@nongnu.org On Mon, Aug 31, 2015 at 09:51:00PM -0400, Jeff Cody wrote: > On Tue, Sep 01, 2015 at 09:29:31AM +0800, Liu Yuan wrote: > > From: Liu Yuan > > > > We need to discard the payload if we get a invalid header due to whatever reason > > to avoid data stream curruption. > > If the header is invalid / corrupted, how can rsp.data_length be > trusted? Out of curiosity, is this an issue you are seeing occur "in > the wild"? This is the defensive patch. Header is invalid in the sense that only rsp.id is invalid due to sheepdog driver bugs, for e.g., the request was misplaced after being sent or duplicated requests sending to sheep daemon and get the duplicated responses for the same request. Actually in the late 2012 we had seen this problem but we didn't find the root cause how this happened by looking at the code statically and the problem was gone silently while we restructured the code. But yesterday some centos6 users reported to me the problem of 'cannot find aio_req' and hang the guest disk. That QEMU's sheepdog driver was rather old and would bump rsp.id mismatch problem as we did in the late 2012. By looking at the code again, I found this error handling problem. However, this patch is not aimed to solve the rsp.id mismatch problem (If it still exist) but just a defensive one after this problem happens. Thanks, Yuan