| To: | xfs@xxxxxxxxxxx |
|---|---|
| Subject: | Re: [PATCH 03/19] mkfs: Sanitise the superblock feature macros |
| From: | Eric Sandeen <sandeen@xxxxxxxxxxx> |
| Date: | Wed, 6 Apr 2016 19:12:21 -0500 |
| Delivered-to: | xfs@xxxxxxxxxxx |
| In-reply-to: | <1458818136-56043-4-git-send-email-jtulak@xxxxxxxxxx> |
| References: | <1458818136-56043-1-git-send-email-jtulak@xxxxxxxxxx> <1458818136-56043-4-git-send-email-jtulak@xxxxxxxxxx> |
| User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 |
On 3/24/16 6:15 AM, jtulak@xxxxxxxxxx wrote:
> @@ -1262,10 +1358,11 @@ main(
> switch (getsubopt(&p, (constpp)iopts, &value)) {
> case I_ALIGN:
> if (!value || *value == '\0')
> - value = "1";
> - iaflag = atoi(value);
> - if (iaflag < 0 || iaflag > 1)
> + reqval('i', iopts, I_ALIGN);
> + c = atoi(value);
> + if (c < 0 || c > 1)
> illegal(value, "i align");
> + sb_feat.inode_align = c ? true : false;
> break;
> case I_LOG:
> if (!value || *value == '\0')
Hm, this seems wrong, as well - per the man page:
"If the value is omitted, 1 is assumed."
but this change with the reqval() removes that, doesn't it? Why?
(it's fixed later, but there is no reason to break it mid-series...)
Before this patch:
# mkfs/mkfs.xfs -dfile,name=fsfile,size=1g -i align
meta-data=fsfile isize=512 agcount=4, agsize=65536 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=0
data = bsize=4096 blocks=262144, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
After this patch:
# mkfs/mkfs.xfs -dfile,name=fsfile,size=1g -i align
-i align option requires a value
Usage: mkfs.xfs
/* blocksize */ [-b log=n|size=num]
/* metadata */ [-m crc=0|1,finobt=0|1,uuid=xxx]
/* data subvol */ [-d agcount=n,agsize=n,file,name=xxx,size=num,
(sunit=value,swidth=value|su=num,sw=num|noalign),
sectlog=n|sectsize=num
...
-Eric
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [PATCH 04/19] mkfs: validate all input values, Eric Sandeen |
|---|---|
| Next by Date: | Re: [PATCH] xfs_quota: print quota id number if the name can't be found, Zorro Lang |
| Previous by Thread: | Re: [PATCH 03/19] mkfs: Sanitise the superblock feature macros, Jan Tulak |
| Next by Thread: | Re: [PATCH 03/19] mkfs: Sanitise the superblock feature macros, Eric Sandeen |
| Indexes: | [Date] [Thread] [Top] [All Lists] |