archive mirror
 help / color / mirror / Atom feed
* [PATCH] regression: bfs endianness bug
@ 2007-12-05  8:32 Al Viro
  0 siblings, 0 replies; only message in thread
From: Al Viro @ 2007-12-05  8:32 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Dmitri Vorobiev, Tigran Aivazian, linux-kernel

BFS_FILEBLOCKS() expects struct bfs_inode * (on-disk data, with little-endian
fields), not struct bfs_inode_info * (in-core stuff, with host-endian ones).
It's a macro and fields with the right names are present in bfs_inode_info,
so it compiles, but on big-endian host it gives bogus results.

Introduced in commit f433dc56344cb72cc3de5ba0819021cec3aef807 (Fixes to the
BFS filesystem driver).

Signed-off-by: Al Viro <>
diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c
index 294c41b..a64a71d 100644
--- a/fs/bfs/inode.c
+++ b/fs/bfs/inode.c
@@ -178,7 +178,8 @@ static void bfs_delete_inode(struct inode *inode)
         if (bi->i_dsk_ino) {
-		info->si_freeb += BFS_FILEBLOCKS(bi);
+		if (bi->i_sblock)
+			info->si_freeb += bi->i_eblock + 1 - bi->i_sblock;
 		clear_bit(ino, info->si_imap);
 		dump_imap("delete_inode", s);

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

only message in thread, other threads:[~2007-12-05  8:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-05  8:32 [PATCH] regression: bfs endianness bug Al Viro

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).