android_kernel_xiaomi_sm8350/fs/ufs
Thomas Stewart d27d7a9a78 ufs: permit mounting of BorderWare filesystems
I recently had to recover some files from an old broken machine that was
running BorderWare Document Gateway.  It's basically a drop in web server
for sharing files.  From the look of the init process and using strings on
of a few files it seems to be based on FreeBSD 3.3.

The process turned out to be more difficult than I imagined, but to cut a
long story short BorderWare in their wisdom use a nonstandard magic number
in their UFS (ufstype=44bsd) file systems.  Thus Linux refuses to mount
the file systems in order to recover the data.  After a bit of hunting I
was able to make a quick fix to fs/ufs/super.c in order to detect the new
magic number.

I assume that this number is the same for all installations.  It's quite
easy to find out from ufs_fs.h.  The superblock sits 8k into the block
device and the magic number its 1372 bytes into the superblock struct.

# dd if=/dev/sda5 skip=$(( 8192 + 1372 )) bs=1 count=4 2> /dev/null | hd
00000000  97 26 24 0f                                       |.&$.|
#

Signed-off-by: Thomas Stewart <thomas@stewarts.org.uk>
Cc: Evgeniy Dushistov <dushistov@mail.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-05-27 09:12:43 -07:00
..
balloc.c dquot: cleanup space allocation / freeing routines 2010-03-05 00:20:28 +01:00
cylinder.c
dir.c sanitize const/signedness of ufs a bit 2010-03-03 14:07:57 -05:00
file.c dquot: cleanup dquot initialize routine 2010-03-05 00:20:30 +01:00
ialloc.c ufs: replace inode uid,gid,mode initialization with helper function 2010-05-21 18:31:27 -04:00
inode.c ufs: add ufs speciffic ->setattr call 2010-05-21 19:30:40 +02:00
Kconfig
Makefile
namei.c ufs: add ufs speciffic ->setattr call 2010-05-21 19:30:40 +02:00
super.c ufs: permit mounting of BorderWare filesystems 2010-05-27 09:12:43 -07:00
swab.h
symlink.c ufs: add ufs speciffic ->setattr call 2010-05-21 19:30:40 +02:00
truncate.c quota: unify quota init condition in setattr 2010-05-21 19:30:45 +02:00
ufs_fs.h ufs: permit mounting of BorderWare filesystems 2010-05-27 09:12:43 -07:00
ufs.h ufs: add ufs speciffic ->setattr call 2010-05-21 19:30:40 +02:00
util.c
util.h