Bug 203704 - [patch] makefs(8) does not initialize fs_providersize for UFS
Summary: [patch] makefs(8) does not initialize fs_providersize for UFS
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.2-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: Enji Cooper
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2015-10-11 18:02 UTC by Eugene Grosbein
Modified: 2015-11-09 09:30 UTC (History)
5 users (show)

See Also:
ngie: mfc-stable10+
ngie: mfc-stable9+


Attachments
initialise sblock.fs_providersize (473 bytes, patch)
2015-10-11 18:02 UTC, Eugene Grosbein
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Grosbein 2015-10-11 18:02:32 UTC
Created attachment 161920 [details]
initialise sblock.fs_providersize

makefs(8) leaves sblock.fs_providersize uninitialized (zero) that can be easily checked with dumpfs(8). This may lead to other problems, f.e. geom_label kernel module sanity checks do not like zero fs_old_size value and skips such UFS1 file system while tasting (fs_old_size derives from sblock.fs_providersize).
Comment 1 Sean Bruno freebsd_committer freebsd_triage 2015-10-11 22:39:37 UTC
Seems sensible to me.  I'll give Marcel a day or two to comment, else I'll commit.
Comment 2 Marcel Moolenaar freebsd_committer freebsd_triage 2015-10-12 00:28:57 UTC
(In reply to Sean Bruno from comment #1)

Looks good to me.
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-10-13 17:01:14 UTC
A commit references this bug:

Author: sbruno
Date: Tue Oct 13 17:00:14 UTC 2015
New revision: 289225
URL: https://svnweb.freebsd.org/changeset/base/289225

Log:
  makefs(8) leaves sblock.fs_providersize uninitialized (zero) that can be easily
  checked with dumpfs(8). This may lead to other problems, f.e. geom_label kernel
  module sanity checks do not like zero fs_old_size value and skips such UFS1
  file system while tasting (fs_old_size derives from sblock.fs_providersize).

  PR:	203704
  Submitted by:	eugen@grosbein.net
  Reviewed by:	marcel

Changes:
  head/usr.sbin/makefs/ffs/mkfs.c
Comment 4 Eugene Grosbein 2015-10-13 18:51:23 UTC
How about MFC to stable/10?

That whould help cross-building FreeBSD-11/mips using FreeBSD-10/amd64 build box.

And https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203707 too, please.
Comment 5 Ed Maste freebsd_committer freebsd_triage 2015-10-19 20:07:09 UTC
I think these should be MFC'd. I can do it if Sean doesn't get to it.
Comment 6 Enji Cooper freebsd_committer freebsd_triage 2015-10-25 22:12:55 UTC
Bulk taking makefs bugs.
Comment 7 commit-hook freebsd_committer freebsd_triage 2015-11-09 09:29:25 UTC
A commit references this bug:

Author: ngie
Date: Mon Nov  9 09:28:35 UTC 2015
New revision: 290599
URL: https://svnweb.freebsd.org/changeset/base/290599

Log:
  MFC r266930,r289225:

  r266930 (by jmg):

  convert to using the _daddr_t types like newfs was...

  Put the superblock in the correct possition for UFS2... There is a bug
  in FFS that if we don't put it here (for UFS2), it will forcefully
  relocate the superblock, and I believe cause data loss..

  I have a fix for that, but w/ how many releases are broken, we won't be
  able to switch to the better _FLOPPY (block 0) for this for a while..

  r289225 (by sbruno):

  makefs(8) leaves sblock.fs_providersize uninitialized (zero) that can be easily
  checked with dumpfs(8). This may lead to other problems, f.e. geom_label kernel
  module sanity checks do not like zero fs_old_size value and skips such UFS1
  file system while tasting (fs_old_size derives from sblock.fs_providersize).

  PR:	203704
  Submitted by:	eugen@grosbein.net
  Reviewed by:	marcel

Changes:
_U  stable/10/
  stable/10/usr.sbin/makefs/ffs/mkfs.c
Comment 8 commit-hook freebsd_committer freebsd_triage 2015-11-09 09:30:27 UTC
A commit references this bug:

Author: ngie
Date: Mon Nov  9 09:29:39 UTC 2015
New revision: 290600
URL: https://svnweb.freebsd.org/changeset/base/290600

Log:
  MFstable/10 r290599:

  MFC r266930,r289225:

  r266930 (by jmg):

  convert to using the _daddr_t types like newfs was...

  Put the superblock in the correct possition for UFS2... There is a bug
  in FFS that if we don't put it here (for UFS2), it will forcefully
  relocate the superblock, and I believe cause data loss..

  I have a fix for that, but w/ how many releases are broken, we won't be
  able to switch to the better _FLOPPY (block 0) for this for a while..

  r289225 (by sbruno):

  makefs(8) leaves sblock.fs_providersize uninitialized (zero) that can be easily
  checked with dumpfs(8). This may lead to other problems, f.e. geom_label kernel
  module sanity checks do not like zero fs_old_size value and skips such UFS1
  file system while tasting (fs_old_size derives from sblock.fs_providersize).

  PR:	203704
  Submitted by:	eugen@grosbein.net
  Reviewed by:	marcel

Changes:
_U  stable/9/
_U  stable/9/usr.sbin/
_U  stable/9/usr.sbin/makefs/
  stable/9/usr.sbin/makefs/ffs/mkfs.c