Bug 242314 - newfs_msdos(8) -A option prevents using -o but usage says incompatible with -r
Summary: newfs_msdos(8) -A option prevents using -o but usage says incompatible with -r
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 12.1-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: Xin LI
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-30 09:22 UTC by guyyur
Modified: 2020-02-04 19:16 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description guyyur 2019-11-30 09:22:39 UTC
newfs_msdos prevents using -A with -o but complains on -A and -r

Doesn't allow -o but complains on -r
# newfs_msdos -F 16 -c 8 -o 8192 -m 0xF8 -A /dev/ada5s1
newfs_msdos: align (-A) is incompatible with -r

Allows -r
# newfs_msdos -F 16 -c 8 -r 2 -m 0xF8 -A /dev/ada5s1
/dev/ada5s1: 57248 sectors in 7156 FAT16 clusters (4096 bytes/cluster)
BytesPerSec=512 SecPerClust=8 ResSectors=2 FATs=2 RootDirEnts=512 Sectors=57344 Media=0xf8 FATsecs=28 SecPerTrack=63 Heads=16 HiddenSecs=0

Looking at the changes of D15672, I think -r should be blocked when -A is passed so it should be checking
if (o.reserved_sectors)
   errx(1, "align (-A) is incompatible with -r");
instead of
if (o.hidden_sectors_set)
   errx(1, "align (-A) is incompatible with -r");
Comment 1 commit-hook freebsd_committer freebsd_triage 2019-12-03 07:01:57 UTC
A commit references this bug:

Author: delphij
Date: Tue Dec  3 07:01:28 UTC 2019
New revision: 355317
URL: https://svnweb.freebsd.org/changeset/base/355317

Log:
  newfs_msdos: -A is incompatible with -r, not -o.

  PR:		242314
  Submitted by:	Guy Yur <guyyur gmail com>
  MFC after:	2 weeks

Changes:
  head/sbin/newfs_msdos/newfs_msdos.c
Comment 2 Xin LI freebsd_committer freebsd_triage 2019-12-03 07:03:51 UTC
Committed, thanks!
Comment 3 commit-hook freebsd_committer freebsd_triage 2019-12-18 08:09:52 UTC
A commit references this bug:

Author: delphij
Date: Wed Dec 18 08:08:52 UTC 2019
New revision: 355877
URL: https://svnweb.freebsd.org/changeset/base/355877

Log:
  MFC r355317:

  newfs_msdos: -A is incompatible with -r, not -o.

  PR:		242314
  Submitted by:	Guy Yur <guyyur gmail com>

Changes:
_U  stable/12/
  stable/12/sbin/newfs_msdos/newfs_msdos.c
Comment 4 commit-hook freebsd_committer freebsd_triage 2020-02-04 19:16:02 UTC
A commit references this bug:

Author: dim
Date: Tue Feb  4 19:15:58 UTC 2020
New revision: 357516
URL: https://svnweb.freebsd.org/changeset/base/357516

Log:
  MFC r351382 (by delphij):

  When creating a new FAT32 filesystem, use "unknown" (0xFFFFFFFF) for
  FSI_Nxt_Free instead of providing a wrong value.

  With this change, fsck_msdosfs would no longer complain about invalid
  FSInfo information.

  MFC r355317 (by delphij):

  newfs_msdos: -A is incompatible with -r, not -o.

  PR:		242314
  Submitted by:	Guy Yur <guyyur gmail com>

  MFC r357227:

  Merge r357225 from the clang1000-import branch:

  Fix the following -Werror warning from clang 10.0.0 in newfs_msdos:

  sbin/newfs_msdos/newfs_msdos.c:181:2: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
          if (o.align) {
          ^
  sbin/newfs_msdos/newfs_msdos.c:179:5: note: previous statement is here
      if (argc < 1 || argc > 2)
      ^

Changes:
_U  stable/11/
  stable/11/sbin/newfs_msdos/mkfs_msdos.c
  stable/11/sbin/newfs_msdos/newfs_msdos.c