diff options
author | trasz <trasz@FreeBSD.org> | 2014-05-05 09:20:30 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2014-05-05 09:20:30 +0000 |
commit | 54f013e376551734a05a51a5901c00a32da20767 (patch) | |
tree | 828f4b0d3cdfc9165de9cefec934270db9574be0 /sys | |
parent | 7870802b3f95989eb00c58eaa73f940a9198307f (diff) | |
download | FreeBSD-src-54f013e376551734a05a51a5901c00a32da20767.zip FreeBSD-src-54f013e376551734a05a51a5901c00a32da20767.tar.gz |
Make r242379 - the fix for UFS labels disappearing after resizing
the provider - also apply to UFS1 filesystems. This should help with
resizing filesystems created by makefs(8), which still uses UFS1.
Tested by: jmg@
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys')
-rw-r--r-- | sys/geom/label/g_label_ufs.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/geom/label/g_label_ufs.c b/sys/geom/label/g_label_ufs.c index 46a3cb1..ef012a9 100644 --- a/sys/geom/label/g_label_ufs.c +++ b/sys/geom/label/g_label_ufs.c @@ -81,13 +81,15 @@ g_label_ufs_taste_common(struct g_consumer *cp, char *label, size_t size, int wh fs = (struct fs *)g_read_data(cp, superblock, SBLOCKSIZE, NULL); if (fs == NULL) continue; - /* Check for magic. We also need to check if file system size is equal + /* + * Check for magic. We also need to check if file system size is equal * to providers size, because sysinstall(8) used to bogusly put first * partition at offset 0 instead of 16, and glabel/ufs would find file * system on slice instead of partition. */ if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_fsize > 0 && - pp->mediasize / fs->fs_fsize == fs->fs_old_size) { + ((pp->mediasize / fs->fs_fsize == fs->fs_old_size) || + (pp->mediasize / fs->fs_fsize == fs->fs_providersize))) { /* Valid UFS1. */ } else if (fs->fs_magic == FS_UFS2_MAGIC && fs->fs_fsize > 0 && ((pp->mediasize / fs->fs_fsize == fs->fs_size) || |