Skip to content

Commit

Permalink
regression: bfs endianness bug
Browse files Browse the repository at this point in the history
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 f433dc5 ("Fixes to
the BFS filesystem driver").

Signed-off-by: Al Viro <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Al Viro authored and Linus Torvalds committed Dec 5, 2007
1 parent 3c50b36 commit 7e46aa5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/bfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7e46aa5

Please sign in to comment.