From patchwork Thu Mar 12 19:23:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 5998521 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CAA80BF90F for ; Thu, 12 Mar 2015 19:26:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1ED5320375 for ; Thu, 12 Mar 2015 19:26:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3C4BD20374 for ; Thu, 12 Mar 2015 19:26:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755408AbbCLTY2 (ORCPT ); Thu, 12 Mar 2015 15:24:28 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43169 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755076AbbCLTXd (ORCPT ); Thu, 12 Mar 2015 15:23:33 -0400 Received: from akpm3.mtv.corp.google.com (unknown [216.239.45.95]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 6BE1313; Thu, 12 Mar 2015 19:23:32 +0000 (UTC) Date: Thu, 12 Mar 2015 12:23:31 -0700 From: Andrew Morton To: Andrew Vagin Cc: Andrey Vagin , , , , Jonathan Corbet , Alexander Viro , Jeff Layton , "J. Bruce Fields" , "Cyrill Gorcunov" , Pavel Emelyanov , "Joe Perches" Subject: Re: [PATCH] proc: show locks in /proc/pid/fdinfo/X Message-Id: <20150312122331.d8c27baf40d56e764f223193@linux-foundation.org> In-Reply-To: <20150312155441.GA19139@paralelels.com> References: <1425569838-20416-1-git-send-email-avagin@openvz.org> <20150311150853.492fee52def529e86506976b@linux-foundation.org> <20150312155441.GA19139@paralelels.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, 12 Mar 2015 18:54:42 +0300 Andrew Vagin wrote: > v2: use seq_has_overflowed() properly So it returns "success" when the output has overflowed? Why this, rather than returning an error? --- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/fs/proc/fd.c~proc-show-locks-in-proc-pid-fdinfo-x-v2 +++ a/fs/proc/fd.c @@ -57,17 +57,15 @@ static int seq_show(struct seq_file *m, real_mount(file->f_path.mnt)->mnt_id); show_fd_locks(m, file, files); - ret = seq_has_overflowed(m); - if (ret) + if (seq_has_overflowed(m)) goto out; if (file->f_op->show_fdinfo) file->f_op->show_fdinfo(m, file); - ret = seq_has_overflowed(m); out: fput(file); - return ret; + return 0; } static int seq_fdinfo_open(struct inode *inode, struct file *file)