From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH 3.12-rc7] KVM: Fix modprobe failure for kvm_intel/kvm_amd Date: Wed, 30 Oct 2013 17:08:09 +0100 Message-ID: <52712EE9.9050402@redhat.com> References: <1383059634-55512-1-git-send-email-tim.gardner@canonical.com> <52700C24.9050001@linux.vnet.ibm.com> <52711121.9030606@linux.vnet.ibm.com> <20131030142359.GA32196@kroah.com> <5271284A.6000002@linux.vnet.ibm.com> <527129D4.3010308@redhat.com> <20131030155930.GA23433@kroah.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Raghavendra K T , Linus Torvalds , Tim Gardner , Linux Kernel Mailing List , the arch/x86 maintainers , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Gleb Natapov , Marcelo Tosatti , KVM list , Al Viro To: Greg KH Return-path: In-Reply-To: <20131030155930.GA23433@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org Il 30/10/2013 16:59, Greg KH ha scritto: >> > Even if it is okay to exit and not create the files (and I think it's a >> > bit surprising), I'd like at least a printk to signal what's happening. >> > But there should be no reason for debugfs directory creation to fail in >> > the end, except for basic mistakes such as the one that Tim reported, so >> > I think it's better to report the failure. > Creation will "fail" if debugfs is not enabled, so spiting out printk > messages in that case is not a good idea. Interestingly, if debugfs is not enabled we are already returning an error-valued pointer: static inline struct dentry *debugfs_create_dir(const char *name, struct dentry *parent) { return ERR_PTR(-ENODEV); } which would oops a lot of the current callers. Very few places use the currently correct idiom if (IS_ERR(root) || !root) but it's very ugly... Perhaps debugfs_create_dir *should* return an error-valued pointer after all. Paolo