debugfs: fix mknod command on some 32-bit platforms due to LFS

On some platforms the layout of struct stat changes if
_FILE_OFFSET_BITS is set to 64 (which force the use of 64-bit types
and 64-bit variants for system calls such as stat, lseek, etc.)

This is not true (mercifully) on i386, but it is true for the 32-bit
mips platform on Linux.  This caused debugfs's mknod command to fail,
since it used struct stat to pass the desired st_mode and st_rdev
fields for the to-be-created device file or FIFO, and this would be
different for create_inode.c and debugfs.c.

Linking together different object files together compiled with
different values of _FILE_OFFSET_BITS is perilous, but for now, let's
fix the specific problem by passing the two fields in the stat
structure that we really care about.  This fixes two regression tests
on the 32-bit MIPS platform: d_special_files and r_move_itable.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
3 files changed