linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 02/49] vfs: Add BUG_ON for delayed and unwritten flags in submit_bh()
       [not found] ` <1244488987-32564-2-git-send-email-tytso@mit.edu>
@ 2009-06-08 19:22   ` Theodore Ts'o
  0 siblings, 0 replies; only message in thread
From: Theodore Ts'o @ 2009-06-08 19:22 UTC (permalink / raw)
  To: Linux Kernel Developers List
  Cc: Aneesh Kumar K.V, Theodore Ts'o, linux-fsdevel

From: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

The BH_Delay and BH_Unwritten flags should never leak out to
submit_bh().  So add some BUG_ON() checks to submit_bh so we can get a
stack trace and determine how and why this might have happened.

(Note that only XFS and ext4 use these buffer head flags, and XFS does
not use submit_bh().  So this patch should only modify behavior for
ext4.)

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: linux-fsdevel@vger.kernel.org
---
 fs/buffer.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/buffer.c b/fs/buffer.c
index aed2977..ad01129 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2933,6 +2933,8 @@ int submit_bh(int rw, struct buffer_head * bh)
 	BUG_ON(!buffer_locked(bh));
 	BUG_ON(!buffer_mapped(bh));
 	BUG_ON(!bh->b_end_io);
+	BUG_ON(buffer_delay(bh));
+	BUG_ON(buffer_unwritten(bh));
 
 	/*
 	 * Mask in barrier bit for a write (could be either a WRITE or a
-- 
1.6.3.2.1.gb9f7d.dirty


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-06-08 19:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1244488987-32564-1-git-send-email-tytso@mit.edu>
     [not found] ` <1244488987-32564-2-git-send-email-tytso@mit.edu>
2009-06-08 19:22   ` [PATCH 02/49] vfs: Add BUG_ON for delayed and unwritten flags in submit_bh() Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).