mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Robert W. Maloy" <r.w.maloy@acm.org>
To: linux-kernel@vger.kernel.org
Subject: Possible error in fs/buffer.c
Date: Thu, 1 Apr 2004 10:43:49 -0500	[thread overview]
Message-ID: <200404011043.49077.r.w.maloy@acm.org> (raw)

	While code surfing I found what appears to be a problem with the 
following code in fs/buffer.c {function mark_buffer_inode_dirty}: 

       if (list_empty(&bh->b_assoc_buffers))
                buffer_insert_list(&buffer_mapping->private_lock,
                                bh, &mapping->private_list);

	From my research, the job of buffer_insert_list is to place the list 
contents of bh->b_assoc_buffers onto the list mapping->private list. 
The above code segment will only call buffer_insert_list if 
b_assoc_buffers is empty. Why waste the time, and resources 
attempting to add an empty list to the end of private_list?

	If this is a problem, then there are two possibilities for fixing 
this code: 

    1) This was just a mistake
	add "!" in the if, this only adds the list if there is 
        something to add.
		- if (list_empty(&bh->b_assoc_buffers))
		+ if (!list_empty(&bh->b_assoc_buffers))

    2) Some of the assoc buffers may already be on the private_list. 
If this is a possibility then this routine will need more work.
	


Please CC me on all responses since I am not a member of this list.

-- 
Cheers
Rob Maloy
r.w.maloy@acm.org
(410) 854-6637

             reply	other threads:[~2004-04-01 15:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-01 15:43 Robert W. Maloy [this message]
2004-04-02  0:26 ` Andrew Morton
2004-04-02 10:46   ` Robert W. Maloy

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=200404011043.49077.r.w.maloy@acm.org \
    --to=r.w.maloy@acm.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®