From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Snitzer Subject: Re: convert dm-thin to use dm-bufio Date: Fri, 19 Aug 2011 06:17:19 -0400 Message-ID: <20110819101718.GA1335@redhat.com> References: <20110815090416.GE3159@ubuntu> <20110816091600.GA4284@ubuntu> <20110817082656.GA3267@ubuntu> <20110819070435.GA32300@redhat.com> <20110819091106.GA3193@ubuntu> <20110819094604.GA1059@redhat.com> Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20110819094604.GA1059@redhat.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: Joe Thornber Cc: dm-devel@redhat.com, Mikulas Patocka , "Alasdair G. Kergon" List-Id: dm-devel.ids On Fri, Aug 19 2011 at 5:46am -0400, Mike Snitzer wrote: > On Fri, Aug 19 2011 at 5:11am -0400, > Joe Thornber wrote: > > > An alternative would be to iterate through all the pools in the system > > check whether any of them already had the same metadata device open. > > Of course this doesn't catch the cases where the stacking is used and > > a metadata device eventually maps onto the same physical disk as an > > existing md area. > > The lack of checking for a metadata or data device that is already in > use should probably be fixed. > > As for stacking, can't we just read the superblock to check if a device > is already in use (would work metadata anyway)? No idea if that'd be > too costly -- probably not: read superblock and check if > THIN_SUPERBLOCK_MAGIC is set. Bleh, that won't work. THIN_SUPERBLOCK_MAGIC is the same for all devices... dm_pool_metadata_open() knows when a superblock isn't all zeroes. We could read the suerblock's uuid (which we provisioned for in the superblock but don't yet set) and then go searching all other pools to see if the same superblock uuid exists.