From: Enoch Root Subject: Re-using bio Date: Thu, 22 May 2014 00:49:50 -0700 (PDT) Message-ID: <1400744990.4773.YahooMailNeo@web160603.mail.bf1.yahoo.com> Reply-To: Enoch Root , device-mapper development Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: "dm-devel@redhat.com" List-Id: dm-devel.ids Hi, Is it legal to re-use a bio that has been through a call to generic_make_re= quest? Assuming I want to perform read-modify-write, where modify part also comes = from some other part of the disk, would it be legal to 1) alloc bio, add e.g. 4 pages to it, set the starting sector 2) call generic_make_request to read data 3) assuming I want to change page 3, clone the bio, change idx, to point to= page 3, set the starting sector and the size 4) call generic_make_request to modify page 3 by reading data into it 5) change the direction of the original bio from read to write 6) call generic_make_request to write it back to disk I have already attempted doing this, but I hit BUG_ON(bio->bi_next) in gene= ric_make_request. =A0Am am doing something wrong or this is not how it shou= ld be done? =A0If so, please let me know how to do it properly.=A0 Thanks!