From: Alasdair G Kergon Subject: Re: [PATCH 11/24] dm table: print error on preresume failure Date: Fri, 25 Oct 2013 20:22:16 +0100 Message-ID: <20131025192216.GJ17070@agk-dp.fab.redhat.com> References: <1382639437-27007-1-git-send-email-snitzer@redhat.com> <1382639437-27007-12-git-send-email-snitzer@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: <1382639437-27007-12-git-send-email-snitzer@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: Mike Snitzer Cc: Morgan Mears , Heinz Mauelshagen , dm-devel@redhat.com, Joe Thornber List-Id: dm-devel.ids On Thu, Oct 24, 2013 at 02:30:24PM -0400, Mike Snitzer wrote: > If preresume fails it is worth logging an error given that a device is > left suspended due to the failure. Indeed. > This change was motivated by local preresume error logging that was > added to the cache target. Elevating this error logging to DM core > makes sense. But here I disagree: I think it makes more sense not to elevate this logging, but to leave the responsibility for it with the targets themselves. > + DMERR("%s: %s: preresume failed, error = %d", > + dm_device_name(t->md), ti->type->name, r); Elevated, you're only getting a single number displayed. If the targets retain the responsibility, then you should get a more-detailed error message such as: DMERR("aborting resume - crypt key is not set."); DMERR("Unable to resume snapshot source until " "handover completes."); DMERR("Unable to perform snapshot handover until " "source is suspended."); DMERR("could not resize cache metadata"); DMERR("could not load cache mappings"); DMERR("could not load origin discards"); I think we should retain the requirement that each target must log a meaningful message whenever preresume fails. Alasdair