From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Snitzer Subject: Re: [PATCH 7/7] dm-mpath: Fix a race condition in __multipath_map() Date: Tue, 15 Nov 2016 20:50:21 -0500 Message-ID: <20161116015021.GA19469@redhat.com> References: <81bc399e-df90-099d-1b25-bdb0fda3f27c@sandisk.com> <20161116003720.GA19059@redhat.com> <8af6b1c0-3513-8a13-5ebb-8bdf90bf43e0@sandisk.com> <20161116010117.GE19059@redhat.com> <4411f9ca-da76-d222-a2ee-3edc59c82266@sandisk.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <4411f9ca-da76-d222-a2ee-3edc59c82266@sandisk.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: Bart Van Assche Cc: device-mapper development List-Id: dm-devel.ids On Tue, Nov 15 2016 at 8:08pm -0500, Bart Van Assche wrote: > On 11/15/2016 05:01 PM, Mike Snitzer wrote: > >On Tue, Nov 15 2016 at 7:40pm -0500, > >Bart Van Assche wrote: > >>Are you aware that dm_table_determine_type() sets "all_blk_mq" to > >>false if there are no paths, even if the dm device is in blk-mq > >>mode? > > > >That shouldn't matter. Once the type is established, it is used to > >initialize the DM device's request_queue, the type cannot change across > >different table loads. > > For a single queue dm device, what prevents a user from removing all > single queue paths and to add one or more blk-mq paths? I think this > will cause dm_table_determine_type() to change the table type. A new table is created for every table load (any time a multipath device is loaded into the kernel). The DM core disallows a table with a different type to load. It will be rejected within an error. See dm-ioctl.c:table_load()