Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750882AbcDONuL (ORCPT ); Fri, 15 Apr 2016 09:50:11 -0400 Received: from mail02.iobjects.de ([188.40.134.68]:37338 "EHLO mail02.iobjects.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750745AbcDONuJ (ORCPT ); Fri, 15 Apr 2016 09:50:09 -0400 Subject: Re: [PATCH] block: loop: fix filesystem corruption in case of aio/dio To: Ming Lei , Jens Axboe , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, stable@vger.kernel.org References: <1460717488-19796-1-git-send-email-ming.lei@canonical.com> <5710E3C9.6020408@googlemail.com> Cc: Christoph Hellwig , Keith Busch From: =?UTF-8?Q?Holger_Hoffst=c3=a4tte?= Organization: Applied Asynchrony, Inc. Message-ID: <5710F18E.7060700@googlemail.com> Date: Fri, 15 Apr 2016 15:50:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1548 Lines: 44 -------- Forwarded Message -------- Subject: Re: [PATCH] block: loop: fix filesystem corruption in case of aio/dio Date: Fri, 15 Apr 2016 21:16:42 +0800 From: Ming Lei To: Holger Hoffstätte On Fri, Apr 15, 2016 at 8:51 PM, Holger Hoffstätte wrote: > (off-list since I'm likely missing something..) > > Hello Ming Lei, > > quick question - > > On 04/15/16 12:51, Ming Lei wrote: >> Starting from commit e36f620428(block: split bios to max possible length), >> block core starts to split bio in the middle of bvec. >> >> Unfortunately loop dio/aio doesn't consider this situation, and >> always treat 'iter.iov_offset' as zero. Then filesystem corruption >> is observed. >> >> This patch figures out the offset of the base bvevc via >> 'bio->bi_iter.bi_bvec_done' and fixes the issue by passing the offset >> to iov iterator. >> >> Fixes: e36f6204288088f (block: split bios to max possible length) >> Cc: Keith Busch >> Cc: Al Viro >> Cc: stable@vger.kernel.org (4.5) > ^^^^^ > > The previous patch went into 4.4.x-stable, so should this one not go > into 4.4.x as well? It applies cleanly and does not seem to hurt. > Apologies in advance if this is a bad idea. :) You are absolutely right, this patch should have been marked as stable 4.4+, thanks for point it out! Jens, please let me know if you need me to resend the patch for fixing the stable tag. Thanks, Ming