mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: linux-kernel@vger.kernel.org
Cc: jack@suse.cz, akpm@osdl.org
Subject: [PATCH 4/6] UDF cleanup and fixes
Date: Tue, 6 Mar 2007 17:47:45 +0100	[thread overview]
Message-ID: <20070306164745.GG3661@duck.suse.cz> (raw)
In-Reply-To: <20070306164447.GC3661@duck.suse.cz>

Add a few assertions into udf_discard_prealloc() to check that the file
is sane (mostly helps debugging further patches ;).

Signed-off-by: Jan Kara <jack@suse.cz>

diff -rupX /home/jack/.kerndiffexclude linux-2.6.20-3-udf_buffer_handling/fs/udf/truncate.c linux-2.6.20-4-udf_discard_prealloc_cleanup/fs/udf/truncate.c
--- linux-2.6.20-3-udf_buffer_handling/fs/udf/truncate.c	2007-03-06 15:02:33.000000000 +0100
+++ linux-2.6.20-4-udf_discard_prealloc_cleanup/fs/udf/truncate.c	2007-03-06 15:03:00.000000000 +0100
@@ -88,8 +88,9 @@ void udf_discard_prealloc(struct inode *
 	{
 		etype = netype;
 		lbcount += elen;
-		if (lbcount > inode->i_size && lbcount - inode->i_size < inode->i_sb->s_blocksize)
+		if (lbcount > inode->i_size && lbcount - elen < inode->i_size)
 		{
+			WARN_ON(lbcount - inode->i_size >= inode->i_sb->s_blocksize);
 			nelen = elen - (lbcount - inode->i_size);
 			epos.offset -= adsize;
 			extent_trunc(inode, &epos, eloc, etype, elen, nelen);
@@ -119,6 +120,7 @@ void udf_discard_prealloc(struct inode *
 	}
 	UDF_I_LENEXTENTS(inode) = lbcount;
 
+	WARN_ON(lbcount != inode->i_size);
 	brelse(epos.bh);
 }
 

  parent reply	other threads:[~2007-03-06 16:43 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-06 16:44 [PATCH 0/6] " Jan Kara
2007-03-06 16:46 ` [PATCH 1/6] " Jan Kara
2007-03-07  9:37   ` Christoph Hellwig
2007-03-06 16:46 ` [PATCH 2/6] " Jan Kara
2007-03-07  9:37   ` Christoph Hellwig
2007-03-06 16:47 ` [PATCH 3/6] " Jan Kara
2007-03-07  9:38   ` Christoph Hellwig
2007-03-06 16:47 ` Jan Kara [this message]
2007-03-07  9:38   ` [PATCH 4/6] " Christoph Hellwig
2007-03-06 16:48 ` [PATCH 5/6] " Jan Kara
2007-03-07  9:38   ` Christoph Hellwig
2007-03-06 16:48 ` [PATCH 6/6] " Jan Kara
2007-03-07  9:38   ` Christoph Hellwig
2007-03-30  4:59 ` [PATCH 0/6] " Tino Keitel
2007-03-30 18:06   ` Chuck Ebbert
2007-03-31  9:46     ` Tino Keitel
2007-04-02 14:48       ` Chuck Ebbert
2007-04-04  6:36         ` Tino Keitel
2007-04-12 16:01           ` Jan Kara
2007-04-12 15:59             ` Tino Keitel
2007-04-16 15:23               ` Jan Kara
2007-04-02 12:54   ` Jan Kara
2007-04-02 13:54   ` Jan Kara
2007-04-27 21:54 ` Eric Sandeen
2007-05-03 15:13   ` Jan Kara
2007-05-22 20:39   ` Eric Sandeen
2007-05-23  7:45     ` Jan Kara

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=20070306164745.GG3661@duck.suse.cz \
    --to=jack@suse.cz \
    --cc=akpm@osdl.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

Powered by JetHome