Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751998AbbKKRyQ (ORCPT ); Wed, 11 Nov 2015 12:54:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:32922 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751743AbbKKRyN (ORCPT ); Wed, 11 Nov 2015 12:54:13 -0500 Date: Wed, 11 Nov 2015 12:54:11 -0500 From: Mike Snitzer To: Baolin Wang Cc: axboe@kernel.dk, agk@redhat.com, dm-devel@redhat.com, neilb@suse.com, linux-raid@vger.kernel.org, jack@suse.cz, arnd@arndb.de, linux-kernel@vger.kernel.org, keith.busch@intel.com, jmoyer@redhat.com, broonie@kernel.org, tj@kernel.org, bart.vanassche@sandisk.com, dineshg@quicinc.com Subject: Re: [PATCH 1/2] block: Introduce BIO_ENDIO_FREE for bio flags Message-ID: <20151111175411.GC12236@redhat.com> References: <2bd3cc769530061501af545c7949dcc832263930.1447233227.git.baolin.wang@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2bd3cc769530061501af545c7949dcc832263930.1447233227.git.baolin.wang@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1798 Lines: 41 On Wed, Nov 11 2015 at 4:31am -0500, Baolin Wang wrote: > When we use dm-crypt to decrypt block data, it will decrypt the block data > in endio() when one IO is completed. In this situation we don't want the > cloned bios is freed before calling the endio(). > > Thus introduce 'BIO_ENDIO_FREE' flag to support the request handling for dm-crypt, > this flag will ensure that blk layer does not complete the cloned bios before > completing the request. When the crypt endio is called, post-processsing is > done and then the dm layer will complete the bios (clones) and free them. Not following why request-based DM's partial completion handling (drivers/md/dm.c:end_clone_bio) isn't a sufficient hook -- no need to add block complexity. But that aside, I'm not liking the idea of a request-based dm-crypt. > diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h > index 76d23fa..f636c50 100644 > --- a/include/linux/device-mapper.h > +++ b/include/linux/device-mapper.h > @@ -407,6 +407,11 @@ union map_info *dm_get_rq_mapinfo(struct request *rq); > > struct queue_limits *dm_get_queue_limits(struct mapped_device *md); > > +void dm_end_request(struct request *clone, int error); > +void dm_kill_unmapped_request(struct request *rq, int error); > +void dm_dispatch_clone_request(struct request *clone, struct request *rq); > +struct request *dm_get_orig_rq(struct request *clone); > + > /* > * Geometry functions. > */ I have no interest in seeing any request-based DM interfaces exported. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/