Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp287188pxf; Tue, 6 Apr 2021 22:35:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGsIZxKhWHAjeS8wV4s7+N8uzJqxA+mCQclvN65dZk7dm+ZKrm78oPBKzrW+g/jXqdsqX3 X-Received: by 2002:a02:6a5a:: with SMTP id m26mr1725026jaf.17.1617773747485; Tue, 06 Apr 2021 22:35:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617773747; cv=none; d=google.com; s=arc-20160816; b=r+hhmRd/JosCqc9reB7bCYlHOG+GCAsnkhrYGgO5eD135ptrvU5PMkMKgAlpTQ/dov eA8rD7mbh9Y0PloG28HYw2ZzotGB3Ts0jb3tYq/cI+c2nMz6/TedyEILqrWjaUBmiXkO mryYwTO4B674ahP+DzNFfA5CZxPOMb1JIMmTOZFp+AbwY87sLdWWLsly1wrnlSAU16L6 M85z/GrJTagN3C/Znlxhf2uEK/Bo2K1usRp9X3/25WGtfJ09q4l18lh1GCGjpSjDD4xM LJlXKHLt30LOZXYg5Dwy550WRneU0ux96IKUf7ugOJGvdameB3h+6LOVZDe8zZIBdYtk FTVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=fO78R/i7EbXK0ns3LVhssdIBRtDgSCRSq6Bb+3/tU0o=; b=s9CHEr4j7kti6IvEIk0qPUzJT6D5ZbNFVAzq9OrFui6/mrGNxh0vqZmbpT9rV1RzLT wmeWd6Txlnask0VpUNQQKLKhuCGXIN10C4iU35t5OL3cU0jNukAiMPLJ0DyLhbtnErfP 4Fb8vQyDT84J+g3PKmSOxk7R9dYJ9UnxEWhdWmyX4BFJAC65GjF3jpMNIgIUO2uNQoRk 6aRk4og/JPsfO6ff/6QykX8CoY44NdE0goqvwovmG/dsJtnwEG3ro5NQKGcMwQ2wHx1l c06npFzwxDALz2nnOXT1jYq3rNPi6/AavTzXI86w3NRi24ZulfgEAgPNWQ7mAWwm5OA9 qp9g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i13si23757520ilm.103.2021.04.06.22.35.35; Tue, 06 Apr 2021 22:35:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345294AbhDFOqQ (ORCPT + 99 others); Tue, 6 Apr 2021 10:46:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:48168 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233235AbhDFOqQ (ORCPT ); Tue, 6 Apr 2021 10:46:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E5CF6613C0; Tue, 6 Apr 2021 14:46:05 +0000 (UTC) Date: Tue, 6 Apr 2021 16:46:02 +0200 From: Christian Brauner To: Al Viro Cc: Jens Axboe , syzbot , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, io-uring@vger.kernel.org Subject: Re: [syzbot] WARNING in mntput_no_expire (2) Message-ID: <20210406144602.iqvtsybmhv7ww5en@wittgenstein> References: <20210405170801.zrdhnon6g4ggb6c7@wittgenstein> <20210405200737.qurhkqitoxweousx@wittgenstein> <20210406123505.auxqtquoys6xg6yf@wittgenstein> <20210406132205.qnherkzif64xmgxg@wittgenstein> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 06, 2021 at 02:15:01PM +0000, Al Viro wrote: > On Tue, Apr 06, 2021 at 03:22:05PM +0200, Christian Brauner wrote: > > > Why is a another function in charge of checking the return value of an > > initialization function. If something like path_init() fails why is the > > next caller responsible for rejecting it's return value and then we're > > passing that failure value through the whole function with if (!err) > > ladders but as I said it's mostly style preferences. > > Because otherwise you either need *all* paths leading to link_path_walk() > duplicate the logics (and get hurt whenever you miss one) or have "well, > in some cases link_path_walk() handles ERR_PTR() given to it, in some > cases its caller do" mess. > > > > > s = path_init(nd, flags); > > > > - if (IS_ERR(s)) > > > > - return PTR_ERR(s); > > > > > > Where has that come from, BTW? Currently path_lookupat() does no such thing. > > > > Hm? Are you maybe overlooking path_init() which assigns straight into > > the variable declaration? Or are you referring to sm else? > > I'm referring to the fact that your diff is with an already modified path_lookupat() > _and_ those modifications have managed to introduce a bug your patch reverts. > No terminate_walk() paired with that path_init() failure, i.e. path_init() is > responsible for cleanups on its (many) failure exits... Note that the paste post the patch was just a doodle to illustrate the point not sm to review in earnest (I should probably comment prefix things like this with "untested".).