Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751850AbcDOO0O (ORCPT ); Fri, 15 Apr 2016 10:26:14 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:37454 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751242AbcDOO0M (ORCPT ); Fri, 15 Apr 2016 10:26:12 -0400 Subject: Re: [PATCH] block: loop: fix filesystem corruption in case of aio/dio To: Ming Lei , References: <1460717488-19796-1-git-send-email-ming.lei@canonical.com> CC: , Christoph Hellwig , Keith Busch , Al Viro , "4.5" From: Jens Axboe Message-ID: <5710F9E0.2050900@fb.com> Date: Fri, 15 Apr 2016 08:25:36 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1460717488-19796-1-git-send-email-ming.lei@canonical.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.54.13] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-04-15_12:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 755 Lines: 22 On 04/15/2016 04:51 AM, 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) > Signed-off-by: Ming Lei Thanks Ming, queued up. -- Jens Axboe