Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4844336img; Tue, 26 Mar 2019 18:49:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqzZ3mjyefyFUlsAcbNXXepOvm7lanJ3HZn8OhH2D08jB5veGjT4SzhXubxXs2JHOBDPEvFy X-Received: by 2002:a17:902:b217:: with SMTP id t23mr34883270plr.184.1553651386893; Tue, 26 Mar 2019 18:49:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553651386; cv=none; d=google.com; s=arc-20160816; b=Q5UmBusPKXEwv9CROfNn/vX4B1AKD1o3v7ccRp1e2wFxPZR0u0UF/xwjc5hjbO5RRS YjSg+HpFXR+e/xcHXTIxLZnKrspW+lgS46vKlD40F5vzOyeLsVaQpfZjgVkFxca1ilnv uVVKKZnR0VOa7Qgk3HOUPKAZLgAapUPxNbuYB2lD8HVXj1i9jJTp7Wr/vzuNNC64iyge j7HweX4XKsl7114sdVAQxSxXROTyfD3nhFLiiXij0rkRu19cb5e/1dWU18Mbdqk9BOMk 7B9yfOG0VOQmjiJ6Yc7ojtuaurMLS1O2Q0OA5zZCk7QW2pfwVKSoS8sVlsRQQegMiUoE EYBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=l0+FE3R7y4eKhOfGWYrRGcNP1DJMRU69lrfnv9T01WQ=; b=cJ9Y4+FwK5LxOdpW+tsEWzTbjoMvISbR3r/MqLCsYRKOxh86gwzTTzbWQO0O1/B0JX CtYWs1rH2VifCPLPQhPznfZUYyrSDb/2DlA4zp7UEKlK6X6hktVjjcqiw8MmgJNZ26QL CcHoicBMPoLmpgCrTj36H0umy8/OHvS2nfRP1nuMetmUkMIO7CiHEBgK1Rh/pB6oQ61D l0r7iermOh8JdLVgRmKFT3pUzHv8YNp68GQku3FmTQOSKtT7CCepAUuuC5QlI4rSTUMr Ul3xAEwMIefi84t0AreCRYQo5xT6GaLZCy40rKnDMliDpWTUAdg9Lwd19SPI1VPVOBeN Qy4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d6si17280765pfg.66.2019.03.26.18.49.19; Tue, 26 Mar 2019 18:49:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732271AbfC0Brh (ORCPT + 99 others); Tue, 26 Mar 2019 21:47:37 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:36619 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730441AbfC0Brg (ORCPT ); Tue, 26 Mar 2019 21:47:36 -0400 Received: by mail-qt1-f196.google.com with SMTP id s15so1409592qtn.3 for ; Tue, 26 Mar 2019 18:47:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=l0+FE3R7y4eKhOfGWYrRGcNP1DJMRU69lrfnv9T01WQ=; b=CNm8PzT/DoRYQXj/i0UZTYDH7hwFlxDP78KPxVIzRKKO84lliZ0h941r/Lq3po8gxU 67xM+JKpg3XfBzfF21tzzF3O9cGNrdkcKrkI5ir4OnT2AuV5OfqSO7J6CyHEBVbvbQYD 4AhQePIgKSUBU19aP6q/M4WNIakEsR2dWrYziE9IHAx6ZDnRKMeSfBg8L9bVQ+A+QzaA UjwOpf56DMjbOmIOXdjgchmOmEWpo0QRtklJFzQyWFjLIGOkgxaWN3zGqXvUDwIhcQMr 2/bZKMJdAwH5Iubosr6GQP2k4X88g1ZKiuTSXodPF9K1Ywf4XrGthvr1ktak7M1k5bxI xUMg== X-Gm-Message-State: APjAAAXA3MIFh+m2yMyu1p5hRjlN0sKCYcpWnwzRLoPZ9x2Y/y0yfcCr I3nqtR7wKj11AvdaaY9juLLTEg== X-Received: by 2002:ac8:51cd:: with SMTP id d13mr19046824qtn.45.1553651255916; Tue, 26 Mar 2019 18:47:35 -0700 (PDT) Received: from ?IPv6:2601:602:9800:dae6::fa4a? ([2601:602:9800:dae6::fa4a]) by smtp.gmail.com with ESMTPSA id m41sm3790039qtb.58.2019.03.26.18.47.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Mar 2019 18:47:35 -0700 (PDT) Subject: Re: [PATCH] iwlwifi: mvm: no need to check return value of debugfs_create functions To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Johannes Berg , Emmanuel Grumbach , Luca Coelho , Intel Linux Wireless , Kalle Valo , linux-wireless@vger.kernel.org References: <20190122152151.16139-24-gregkh@linuxfoundation.org> <03bb68be-8e42-a463-2d57-3be051dc2016@redhat.com> <20190327012600.GA3649@kroah.com> From: Laura Abbott Message-ID: <5660d50d-6cbf-3b36-6e6c-312b1617ed23@redhat.com> Date: Tue, 26 Mar 2019 18:47:33 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.0 MIME-Version: 1.0 In-Reply-To: <20190327012600.GA3649@kroah.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/26/19 6:26 PM, Greg Kroah-Hartman wrote: > On Tue, Mar 26, 2019 at 04:55:54PM -0700, Laura Abbott wrote: >> On 1/22/19 7:21 AM, Greg Kroah-Hartman wrote: >>> diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c >>> index 33b0af24a537..c52cdc538678 100644 >>> --- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c >>> +++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c >>> @@ -1446,9 +1446,8 @@ static ssize_t iwl_dbgfs_quota_min_read(struct file *file, >>> #define MVM_DEBUGFS_READ_WRITE_FILE_OPS(name, bufsz) \ >>> _MVM_DEBUGFS_READ_WRITE_FILE_OPS(name, bufsz, struct ieee80211_vif) >>> #define MVM_DEBUGFS_ADD_FILE_VIF(name, parent, mode) do { \ >>> - if (!debugfs_create_file(#name, mode, parent, vif, \ >>> - &iwl_dbgfs_##name##_ops)) \ >>> - goto err; \ >>> + debugfs_create_file(#name, mode, parent, vif, \ >>> + &iwl_dbgfs_##name##_ops); \ >>> } while (0) >>> MVM_DEBUGFS_READ_FILE_OPS(mac_params); >>> @@ -1483,12 +1482,6 @@ void iwl_mvm_vif_dbgfs_register(struct iwl_mvm *mvm, struct ieee80211_vif *vif) >>> mvmvif->dbgfs_dir = debugfs_create_dir("iwlmvm", dbgfs_dir); >>> - if (!mvmvif->dbgfs_dir) { >>> - IWL_ERR(mvm, "Failed to create debugfs directory under %pd\n", >>> - dbgfs_dir); >>> - return; >>> - } >>> - >>> if (iwlmvm_mod_params.power_scheme != IWL_POWER_SCHEME_CAM && >>> ((vif->type == NL80211_IFTYPE_STATION && !vif->p2p) || >>> (vif->type == NL80211_IFTYPE_STATION && vif->p2p))) >>> @@ -1537,12 +1530,6 @@ void iwl_mvm_vif_dbgfs_register(struct iwl_mvm *mvm, struct ieee80211_vif *vif) >>> mvmvif->dbgfs_slink = debugfs_create_symlink(dbgfs_dir->d_name.name, >>> mvm->debugfs_dir, buf); >>> - if (!mvmvif->dbgfs_slink) >>> - IWL_ERR(mvm, "Can't create debugfs symbolic link under %pd\n", >>> - dbgfs_dir); >>> - return; >>> -err: >>> - IWL_ERR(mvm, "Can't create debugfs entity\n"); >>> } >> >> Fedora got a bug report https://bugzilla.redhat.com/show_bug.cgi?id=1691034 >> of a crash with 5.0 and the user did a bisect which pointed to ff9fb72bc077 >> ("debugfs: return error values, not NULL") because the error checking is >> no longer correct in this driver. >> >> Based on https://patchwork.kernel.org/patch/10865839/, it looks like >> this is supposed to go in for 5.2 but this needs to go in now as >> the error checking is currently broken without it. Can this get queued >> for Linus so we can get it in 5.0 stable? > > That's odd, I can't see how the error checking is wrong here. If the > directory is not created, an error will be returned, which should be > able to be handled by debugfs_create_file(). > > So with this patch does the error go away? > The full patch didn't apply cleanly and I didn't try to backport it for the reporter to test. I was going off of the theory that if the patch was there it would fix the problem. What I _think_ is going wrong is dbgfs_dir is actually an errno value: struct dentry *dbgfs_dir = vif->debugfs_dir; struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); char buf[100]; /* * Check if debugfs directory already exist before creating it. * This may happen when, for example, resetting hw or suspend-resume */ if (!dbgfs_dir || mvmvif->dbgfs_dir) return; so this blows up in the snprintf snprintf(buf, 100, "../../../%pd3/%pd", dbgfs_dir, mvmvif->dbgfs_dir); Unless I misunderstood what the debugfs error change did. I think this also means the if check needs to look for IS_ERR and not just !dbgfs_dir. Thanks, Laura > strange, > > greg k-h >