From patchwork Fri Mar 23 18:43:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 148480 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 22622B6EE8 for ; Sat, 24 Mar 2012 05:43:35 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757934Ab2CWSnc (ORCPT ); Fri, 23 Mar 2012 14:43:32 -0400 Received: from mga12.intel.com ([143.182.124.36]:16628 "EHLO azsmga102.ch.intel.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753822Ab2CWSnb (ORCPT ); Fri, 23 Mar 2012 14:43:31 -0400 Received: from mail-iy0-f180.google.com ([209.85.210.180]) by mga14.intel.com with ESMTP/TLS/RC4-SHA; 23 Mar 2012 11:43:30 -0700 Received: by iage36 with SMTP id e36so6271715iag.25 for ; Fri, 23 Mar 2012 11:43:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:from:to:cc:date:in-reply-to:references:content-type :x-mailer:content-transfer-encoding:message-id:mime-version :x-gm-message-state; bh=cHIX8LQl7ERM263kKt0RRb/I0+8LYRRqYGY55p3XFro=; b=SXG9xxgP/OzSwrSGRLQ6/2ScJ8Hue4pxedCr7jKOjRJLeFJEu5NlpQMk1Sze9TyXQ2 Nhsj5d7iMG4kxyAY6EuiayWvUqrMpH73rvjlDHQ/e1xhFdn8xzB+xXD+e7q4O6cn2o/1 iE5n0he/3UDJNCgzppw7M4sqzVPJ1d92Jxmu5AIjGWqrPSS0VikhzDLuFN6rip7RQNy0 UvBEZtwaWq+I+Z9CMhFlrFADNIJrKi0A694qZyp1jk1FEFkpWMpxS3b6rhWhiHtybzJ6 c8c9pGeTf2YBkemAQvDAvPfjvsIdoTwNGS1pXde714xlD0L/k01hKEumDt6HJMiwJDGc i48A== Received: by 10.50.57.129 with SMTP id i1mr2944634igq.33.1332528210121; Fri, 23 Mar 2012 11:43:30 -0700 (PDT) Received: from [192.168.0.8] (static-50-53-161-131.bvtn.or.frontiernet.net. [50.53.161.131]) by mx.google.com with ESMTPS id ke7sm5906169igc.10.2012.03.23.11.43.29 (version=SSLv3 cipher=OTHER); Fri, 23 Mar 2012 11:43:29 -0700 (PDT) Subject: Re: [libsas PATCH v12 04/11] sysfs: handle 'parent deleted before child added' From: Dan Williams To: Greg Kroah-Hartman Cc: linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org Date: Fri, 23 Mar 2012 11:43:28 -0700 In-Reply-To: <20120322143959.GF19835@kroah.com> References: <20120322063127.22036.23206.stgit@dwillia2-linux.jf.intel.com> <20120322063214.22036.77957.stgit@dwillia2-linux.jf.intel.com> <20120322143959.GF19835@kroah.com> X-Mailer: Evolution 3.0.3 (3.0.3-1.fc15) Message-ID: <1332528209.23830.4.camel@ultramagnus.opencreations.com> Mime-Version: 1.0 X-Gm-Message-State: ALoCoQna5b8zUD4kH6SZQ5P9jXhWVGusxL9zJr3UObz1+DCgulsIWZNPcwVMBUOahrlqCUTQTOVE Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org On Thu, 2012-03-22 at 07:39 -0700, Greg Kroah-Hartman wrote: > And note, I hate pr_err(), what's wrong with printk() in this instance? So how about an end run around the conversion to pr_err() and just make these proper WARN()s since we end up calling dump_stack in both cases? Something like: --- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/lib/kobject.c b/lib/kobject.c index e5f86c0..1bd0893 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -192,15 +192,14 @@ static int kobject_add_internal(struct kobject *kobj) /* be noisy on error issues */ if (error == -EEXIST) - pr_err("%s failed for %s with " - "-EEXIST, don't try to register things with " - "the same name in the same directory.\n", - __func__, kobject_name(kobj)); + WARN(1, "%s failed for %s with " + "-EEXIST, don't try to register things with " + "the same name in the same directory.\n", + __func__, kobject_name(kobj)); else - pr_err("%s failed for %s (error: %d parent: %s)\n", - __func__, kobject_name(kobj), error, - parent ? kobject_name(parent) : "'none'"); - dump_stack(); + WARN(1, "%s failed for %s (error: %d parent: %s)\n", + __func__, kobject_name(kobj), error, + parent ? kobject_name(parent) : "'none'"); } else kobj->state_in_sysfs = 1;