alistair23-linux/fs/ext4
Eric Sandeen ad4eec6135 ext4: allow specifying external journal by pathname mount option
It's always been a hassle that if an external journal's
device number changes, the filesystem won't mount.
And since boot-time enumeration can change, device number
changes aren't unusual.

The current mechanism to update the journal location is by
passing in a mount option w/ a new devnum, but that's a hassle;
it's a manual approach, fixing things after the fact.

Adding a mount option, "-o journal_path=/dev/$DEVICE" would
help, since then we can do i.e.

# mount -o journal_path=/dev/disk/by-label/$JOURNAL_LABEL ...

and it'll mount even if the devnum has changed, as shown here:

# losetup /dev/loop0 journalfile
# mke2fs -L mylabel-journal -O journal_dev /dev/loop0 
# mkfs.ext4 -L mylabel -J device=/dev/loop0 /dev/sdb1

Change the journal device number:

# losetup -d /dev/loop0
# losetup /dev/loop1 journalfile 

And today it will fail:

# mount /dev/sdb1 /mnt/test
mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

# dmesg | tail -n 1
[17343.240702] EXT4-fs (sdb1): error: couldn't read superblock of external journal

But with this new mount option, we can specify the new path:

# mount -o journal_path=/dev/loop1 /dev/sdb1 /mnt/test
#

(which does update the encoded device number, incidentally):

# umount /dev/sdb1
# dumpe2fs -h /dev/sdb1 | grep "Journal device"
dumpe2fs 1.41.12 (17-May-2010)
Journal device:	          0x0701

But best of all we can just always mount by journal-path, and
it'll always work:

# mount -o journal_path=/dev/disk/by-label/mylabel-journal /dev/sdb1 /mnt/test
#

So the journal_path option can be specified in fstab, and as long as
the disk is available somewhere, and findable by label (or by UUID),
we can mount.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
2013-08-28 19:05:07 -04:00
..
acl.c
acl.h
balloc.c ext4: mark group corrupt on group descriptor checksum 2013-08-28 18:46:56 -04:00
bitmap.c
block_validity.c
dir.c ext4: Fix misspellings using 'codespell' tool 2013-08-28 14:40:12 -04:00
ext4.h ext4: mark block group as corrupt on inode bitmap error 2013-08-28 18:32:58 -04:00
ext4_extents.h ext4: isolate ext4_extents.h file 2013-08-28 14:47:06 -04:00
ext4_jbd2.c jbd2: Fix use after free after error in jbd2_journal_dirty_metadata() 2013-08-12 09:53:28 -04:00
ext4_jbd2.h ext4: Fix misspellings using 'codespell' tool 2013-08-28 14:40:12 -04:00
extents.c ext4: isolate ext4_extents.h file 2013-08-28 14:47:06 -04:00
extents_status.c ext4: isolate ext4_extents.h file 2013-08-28 14:47:06 -04:00
extents_status.h ext4: isolate ext4_extents.h file 2013-08-28 14:47:06 -04:00
file.c jbd2: Fix oops in jbd2_journal_file_inode() 2013-08-16 21:19:41 -04:00
fsync.c ext4: Fix fsync error handling after filesystem abort 2013-06-12 22:38:04 -04:00
hash.c
ialloc.c ext4: mark group corrupt on group descriptor checksum 2013-08-28 18:46:56 -04:00
indirect.c ext4: isolate ext4_extents.h file 2013-08-28 14:47:06 -04:00
inline.c Lots of bug fixes, cleanups and optimizations. In the bug fixes 2013-07-02 09:39:34 -07:00
inode.c ext4: Fix misspellings using 'codespell' tool 2013-08-28 14:40:12 -04:00
ioctl.c ext4: isolate ext4_extents.h file 2013-08-28 14:47:06 -04:00
Kconfig ext4: fix Kconfig documentation for CONFIG_EXT4_DEBUG 2013-04-21 20:32:03 -04:00
Makefile
mballoc.c ext4: mark block group as corrupt on block bitmap error 2013-08-28 17:35:51 -04:00
mballoc.h
migrate.c ext4: Fix misspellings using 'codespell' tool 2013-08-28 14:40:12 -04:00
mmp.c ext4: mark all metadata I/O with REQ_META 2013-04-20 15:46:17 -04:00
move_extent.c ext4: cache all of an extent tree's leaf block upon reading 2013-08-16 21:23:41 -04:00
namei.c ext4: allocate delayed allocation blocks before rename 2013-08-16 22:06:53 -04:00
page-io.c ext4: rate limit printk in buffer_io_error() 2013-07-11 22:42:42 -04:00
resize.c ext4: fix corruption when online resizing a fs with 1K block size 2013-07-01 08:12:08 -04:00
super.c ext4: allow specifying external journal by pathname mount option 2013-08-28 19:05:07 -04:00
symlink.c
truncate.h
xattr.c ext4: fix miscellaneous big endian warnings 2013-04-09 23:59:55 -04:00
xattr.h ext4: reserve xattr index for Rich ACL support 2013-04-18 14:53:15 -04:00
xattr_security.c
xattr_trusted.c
xattr_user.c