From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66BADC4361B for ; Fri, 18 Dec 2020 23:00:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1CE5523B23 for ; Fri, 18 Dec 2020 23:00:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726167AbgLRW7q (ORCPT ); Fri, 18 Dec 2020 17:59:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725957AbgLRW7p (ORCPT ); Fri, 18 Dec 2020 17:59:45 -0500 Received: from orbyte.nwl.cc (orbyte.nwl.cc [IPv6:2001:41d0:e:133a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F741C0617A7 for ; Fri, 18 Dec 2020 14:59:05 -0800 (PST) Received: from n0-1 by orbyte.nwl.cc with local (Exim 4.94) (envelope-from ) id 1kqOiD-0006wu-WE; Fri, 18 Dec 2020 23:59:02 +0100 Date: Fri, 18 Dec 2020 23:59:01 +0100 From: Phil Sutter To: Andrea Claudi Cc: netdev@vger.kernel.org, stephen@networkplumber.org, dsahern@gmail.com Subject: Re: [PATCH iproute2 1/2] lib/fs: avoid double call to mkdir on make_path() Message-ID: <20201218225901.GX28824@orbyte.nwl.cc> Mail-Followup-To: Phil Sutter , Andrea Claudi , netdev@vger.kernel.org, stephen@networkplumber.org, dsahern@gmail.com References: <625c55227b1f4e03320940cb087e466f019ca67e.1608315719.git.aclaudi@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <625c55227b1f4e03320940cb087e466f019ca67e.1608315719.git.aclaudi@redhat.com> Sender: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi Andrea, On Fri, Dec 18, 2020 at 08:09:22PM +0100, Andrea Claudi wrote: > make_path() function calls mkdir two times in a row. The first one it > stores mkdir return code, and then it calls it again to check for errno. To me it rather seems like I rebased the original commit into a mess. Or I got really confused by the covscan error message this is based upon. Either way, I don't see why this would not be a bug. :) > This seems unnecessary, as we can use the return code from the first > call and check for errno if not 0. > Fixes: ac3415f5c1b1d ("lib/fs: Fix and simplify make_path()") > Signed-off-by: Andrea Claudi Acked-by: Phil Sutter Thanks, Phil