linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ftp.linux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Dmitri Vorobiev <dmitri.vorobiev@gmail.com>,
	Tigran Aivazian <tigran@veritas.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] regression: bfs endianness bug
Date: Wed, 5 Dec 2007 08:32:52 +0000	[thread overview]
Message-ID: <20071205083252.GE8181@ftp.linux.org.uk> (raw)

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 <viro@zeniv.linux.org.uk>
---
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)
 	brelse(bh);
 
         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;
 		info->si_freei++;
 		clear_bit(ino, info->si_imap);
 		dump_imap("delete_inode", s);

                 reply	other threads:[~2007-12-05  8:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20071205083252.GE8181@ftp.linux.org.uk \
    --to=viro@ftp.linux.org.uk \
    --cc=dmitri.vorobiev@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tigran@veritas.com \
    --cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).