public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ravikiran G Thirumalai <kiran@in.ibm.com>
To: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>
Subject: [patch 2/4] Cleanup file_count usage: Error/debug messages on f_count reads
Date: Tue, 16 Nov 2004 19:33:47 +0530	[thread overview]
Message-ID: <20041116140347.GC23257@impedimenta.in.ibm.com> (raw)
In-Reply-To: <20041116135200.GA23257@impedimenta.in.ibm.com>

Viro doesn't like reads to f_count. This patch cleans up (removes) some
error messages and warnings based on f_count checks. 

We also don't want to have atomic_reads to refcount lying around, since for
converting the f_count refcounter to struct kref and lockfree kref extensions,
krefs might not support read routines to struct kref.

Notes: 
1. Not sure if the debug message in __aio_put_req is _really_ useful. This 
patch removes this debug message for aio.
2. The file_count check to check if the file is already closed in filp_close 
also doesn't seem to be useful, as an fput should have a corresponding fget,
and a close on a closed file will return -EBADF from sys_close itself,
without having to call filp_close
3. Not sure if the debug messages in atm scheduler are _really_ useful either.

Signed-off-by: Ravikiran Thirumalai <kiran@in.ibm.com>
---

 fs/aio.c            |    2 --
 fs/open.c           |    5 -----
 net/sched/sch_atm.c |    3 ---
 3 files changed, 10 deletions(-)

diff -ruN -X dontdiff2 linux-2.6.9/fs/aio.c f_count-2.6.9/fs/aio.c
--- linux-2.6.9/fs/aio.c	2004-10-19 03:24:07.000000000 +0530
+++ f_count-2.6.9/fs/aio.c	2004-11-15 14:07:29.000000000 +0530
@@ -493,8 +493,6 @@
  */
 static int __aio_put_req(struct kioctx *ctx, struct kiocb *req)
 {
-	dprintk(KERN_DEBUG "aio_put(%p): f_count=%d\n",
-		req, atomic_read(&req->ki_filp->f_count));
 
 	req->ki_users --;
 	if (unlikely(req->ki_users < 0))
diff -ruN -X dontdiff2 linux-2.6.9/fs/open.c f_count-2.6.9/fs/open.c
--- linux-2.6.9/fs/open.c	2004-10-19 03:23:08.000000000 +0530
+++ f_count-2.6.9/fs/open.c	2004-11-15 14:07:29.000000000 +0530
@@ -995,11 +995,6 @@
 	if (retval)
 		filp->f_error = 0;
 
-	if (!file_count(filp)) {
-		printk(KERN_ERR "VFS: Close: file count is 0\n");
-		return retval;
-	}
-
 	if (filp->f_op && filp->f_op->flush) {
 		int err = filp->f_op->flush(filp);
 		if (!retval)
diff -ruN -X dontdiff2 linux-2.6.9/net/sched/sch_atm.c f_count-2.6.9/net/sched/sch_atm.c
--- linux-2.6.9/net/sched/sch_atm.c	2004-10-19 03:24:07.000000000 +0530
+++ f_count-2.6.9/net/sched/sch_atm.c	2004-11-15 14:07:29.000000000 +0530
@@ -196,8 +196,6 @@
 	qdisc_destroy(flow->q);
 	destroy_filters(flow);
 	if (flow->sock) {
-		DPRINTK("atm_tc_put: f_count %d\n",
-		    file_count(flow->sock->file));
 		flow->vcc->pop = flow->old_pop;
 		sockfd_put(flow->sock);
 	}
@@ -279,7 +277,6 @@
 	DPRINTK("atm_tc_change: type %d, payload %d, hdr_len %d\n",
 	    opt->rta_type,RTA_PAYLOAD(opt),hdr_len);
 	if (!(sock = sockfd_lookup(fd,&error))) return error; /* f_count++ */
-	DPRINTK("atm_tc_change: f_count %d\n",file_count(sock->file));
         if (sock->ops->family != PF_ATMSVC && sock->ops->family != PF_ATMPVC) {
 		error = -EPROTOTYPE;
                 goto err_out;

  parent reply	other threads:[~2004-11-16 14:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-16 13:52 [patch 0/4] Cleanup file_count usage Ravikiran G Thirumalai
2004-11-16 13:57 ` [patch 1/4] Cleanup file_count usage: Bad usage at some .open, .release Ravikiran G Thirumalai
2004-11-16 14:03 ` Ravikiran G Thirumalai [this message]
2004-11-16 14:06 ` [patch 3/4] Cleanup file_count usage: Redundant check based on file_count Ravikiran G Thirumalai
2004-11-16 14:11 ` [patch 4/4] Cleanup file_count usage: Avoid file_count usage for hugetlb nattach reporting Ravikiran G Thirumalai
2004-11-16 14:24   ` William Lee Irwin III
2004-11-16 22:31 ` [patch 0/4] Cleanup file_count usage Paul Mackerras
2004-11-17 16:50   ` Ravikiran G Thirumalai
2004-11-17 22:07     ` Paul Mackerras
2004-12-01  6:30       ` Ravikiran G Thirumalai
2004-11-16 22:56 ` Jan Harkes
2004-11-16 23:19   ` Jan Harkes
2004-11-17  0:57 ` Willem Riede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041116140347.GC23257@impedimenta.in.ibm.com \
    --to=kiran@in.ibm.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox