Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1031069pxb; Sun, 21 Feb 2021 08:55:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJyaIzzdFNkWgzva7QgNOTblv7sGCjkOcRJaASWTHU7HRSjPYdC+f9kCjnLsZ/rzgDFxChmf X-Received: by 2002:aa7:d2c4:: with SMTP id k4mr1333636edr.237.1613926542170; Sun, 21 Feb 2021 08:55:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613926542; cv=none; d=google.com; s=arc-20160816; b=MuPB7hyXEEQOPT5Z98ytwI+X9YvB+rzt6hrHWQ6teHVzVTiP8CX0NPEDIkqX09Omme NEBhovJyTNQj4ylduU3rmOg7cRiuOMpU2W4ZXDtUyn1uOTXyqbcA1x27VWxLlSV7qPtQ PdfCnaJD6hEQK3P0OWuUc+9Y1YY0kLPXxnlN5KJGjZV4F9EJMk5w9YOzj1mlRMUP246u BfzWLQ8sDdDVDsYIhHsLG1Q3NujFeX4MjoiC8OqTS75sM7wrqPJA9+xBwB7jdeZTOE0l ubKOD5HO2hQVH47WG+iasvp+kvbKNkMXqPqeqLj7ieE1TGy7EX28kG+ZJiT6Du7vKvhg +ABg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=Y0Ca7lGKMv7oij1xWbGCwJ+bPmfotx6mMjZQeF3CQdA=; b=sD1zfsv/3RWWbkDBsQCTOUw60w0/vVmrPZCi3f1BYZu3hneJHPIH1sca9I6qPkAPgv 15UPMenODpBKlcK/ByJQrL/wHJmwfahVEHEYYtejFVn4GnHULmUVCc/vs3hLvBKa1Lc1 RBxzC6GEfhUUOgebM2NN8nq5rA1gCUB+3vbXvjpBkDwemHltsY4WaJZ0maVGIf1pa/2t ZU3CRh4RTnxd0KqhaiPkv5OQ55yF17ol3PBjPbIgdwMPNuQ24IPOGvSnhpMLcL0cYLoz E0NBfCRQDFy7m+lR3wYwbWgrS8t4bUuH6i3tJZ233PImo1wdCKK1hPb2b+5xKEfH3GUd 0f0g== 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 r15si10106719edp.245.2021.02.21.08.55.19; Sun, 21 Feb 2021 08:55:42 -0800 (PST) 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 S230026AbhBUQxY (ORCPT + 99 others); Sun, 21 Feb 2021 11:53:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229685AbhBUQxX (ORCPT ); Sun, 21 Feb 2021 11:53:23 -0500 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3C51C061574; Sun, 21 Feb 2021 08:52:42 -0800 (PST) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94 #2 (Red Hat Linux)) id 1lDryD-00Gicm-Qx; Sun, 21 Feb 2021 16:52:33 +0000 Date: Sun, 21 Feb 2021 16:52:33 +0000 From: Al Viro To: Luo Longjun Cc: jlayton@kernel.org, bfields@fieldses.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, sangyan@huawei.com, luchunhua@huawei.com Subject: Re: [PATCH] fs/locks: print full locks information Message-ID: References: <20210220063250.742164-1-luolongjun@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210220063250.742164-1-luolongjun@huawei.com> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 20, 2021 at 01:32:50AM -0500, Luo Longjun wrote: > > @@ -2844,7 +2845,13 @@ static void lock_get_status(struct seq_file *f, struct file_lock *fl, > if (fl->fl_file != NULL) > inode = locks_inode(fl->fl_file); > > - seq_printf(f, "%lld:%s ", id, pfx); > + seq_printf(f, "%lld: ", id); > + for (i = 1; i < repeat; i++) > + seq_puts(f, " "); > + > + if (repeat) > + seq_printf(f, "%s", pfx); RTFCStandard(printf, %*s), please > +static int __locks_show(struct seq_file *f, struct file_lock *fl, int level) > +{ > + struct locks_iterator *iter = f->private; > + struct file_lock *bfl; > + > + lock_get_status(f, fl, iter->li_pos, "-> ", level); > + > + list_for_each_entry(bfl, &fl->fl_blocked_requests, fl_blocked_member) > + __locks_show(f, bfl, level + 1); Er... What's the maximal depth, again? Kernel stack is very much finite...