Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] ufs2 write: mount as rw

These series of patches add UFS2 write-support. UFS2 - is default file system
for recent versions of FreeBSD.

The main differences from UFS1 from write support point of view
are:
1)Not all inodes are allocated during formatation of disk.
2)All meta-data(pointer to data blocks) are 64bit(in UFS1 they
are 32bit).

So patch series consist of
1)make possible mount UFS2 in read-write mode
2)code to write ufs2 inodes and code to initialize inodes chunks.
3)work with 64bit meta-data

I made simple testing like create/deleting/writing/reading/truncating, also I
ran fsx-linux and untar and build kernel on UFS1 and UFS2, after that FreeBSD
fsck do not find any errors in fs.

This patch makes possible to mount ufs2 "rw", and updates UFS2 documentation:
remove note about bug(it fixed by reallocate blocks on the fly patch) and add
me in the list of people who want receive bug reports.

Signed-off-by: Evgeniy Dushistov <dushistov@mail.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Evgeniy Dushistov and committed by
Linus Torvalds
cbcae39f cca97de1

+8 -10
+4 -5
Documentation/filesystems/ufs.txt
··· 21 21 supported as read-write 22 22 23 23 ufs2 used in FreeBSD 5.x 24 - supported as read-only 24 + supported as read-write 25 25 26 26 5xbsd synonym for ufs2 27 27 ··· 50 50 POSSIBLE PROBLEMS 51 51 ================= 52 52 53 - There is still bug in reallocation of fragment, in file fs/ufs/balloc.c, 54 - line 364. But it seems working on current buffer cache configuration. 53 + See next section, if you have any. 55 54 56 55 57 56 BUG REPORTS 58 57 =========== 59 58 60 - Any ufs bug report you can send to daniel.pirkl@email.cz (do not send 61 - partition tables bug reports.) 59 + Any ufs bug report you can send to daniel.pirkl@email.cz or 60 + to dushistov@mail.ru (do not send partition tables bug reports).
+4 -5
fs/ufs/super.c
··· 61 61 * UFS2 (of FreeBSD 5.x) support added by 62 62 * Niraj Kumar <niraj17@iitbombay.org>, Jan 2004 63 63 * 64 + * UFS2 write support added by 65 + * Evgeniy Dushistov <dushistov@mail.ru>, 2007 64 66 */ 65 67 66 68 ··· 676 674 uspi->s_sbsize = super_block_size = 1536; 677 675 uspi->s_sbbase = 0; 678 676 flags |= UFS_TYPE_UFS2 | UFS_DE_44BSD | UFS_UID_44BSD | UFS_ST_44BSD | UFS_CG_44BSD; 679 - if (!(sb->s_flags & MS_RDONLY)) { 680 - printk(KERN_INFO "ufstype=ufs2 is supported read-only\n"); 681 - sb->s_flags |= MS_RDONLY; 682 - } 683 677 break; 684 678 685 679 case UFS_MOUNT_UFSTYPE_SUN: ··· 1154 1156 #else 1155 1157 if (ufstype != UFS_MOUNT_UFSTYPE_SUN && 1156 1158 ufstype != UFS_MOUNT_UFSTYPE_44BSD && 1157 - ufstype != UFS_MOUNT_UFSTYPE_SUNx86) { 1159 + ufstype != UFS_MOUNT_UFSTYPE_SUNx86 && 1160 + ufstype != UFS_MOUNT_UFSTYPE_UFS2) { 1158 1161 printk("this ufstype is read-only supported\n"); 1159 1162 return -EINVAL; 1160 1163 }