1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

Make g_label(4) ignore provider size when looking for UFS labels.

Without it, it fails to create labels for filesystems resized by
growfs(8).

PR:		kern/165962
Submitted by:	Olivier Cochard-Labbe <olivier at cochard dot me>
This commit is contained in:
Edward Tomasz Napierala 2012-05-24 16:48:33 +00:00
parent 0edc703a02
commit 202f0f2a02
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=235918

View File

@ -81,12 +81,10 @@ 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 and make sure things are the right size */
if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_fsize > 0 &&
pp->mediasize / fs->fs_fsize == fs->fs_old_size) {
/* Check for magic */
if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_fsize > 0) {
/* Valid UFS1. */
} else if (fs->fs_magic == FS_UFS2_MAGIC && fs->fs_fsize > 0 &&
pp->mediasize / fs->fs_fsize == fs->fs_size) {
} else if (fs->fs_magic == FS_UFS2_MAGIC && fs->fs_fsize > 0) {
/* Valid UFS2. */
} else {
g_free(fs);