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: 2019-12-03 07:03 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 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!