Bug 242314

Summary: newfs_msdos(8) -A option prevents using -o but usage says incompatible with -r
Product: Base System Reporter: guyyur
Component: binAssignee: Xin LI <delphij>
Status: Closed FIXED    
Severity: Affects Only Me CC: delphij, emaste
Priority: ---    
Version: 12.1-RELEASE   
Hardware: Any   
OS: Any   

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 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 2019-12-03 07:03:51 UTC
Committed, thanks!
Comment 3 commit-hook freebsd_committer 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