]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_io: Make -D and -R options incompatible explicitly
authorXiao Yang <yangx.jy@cn.fujitsu.com>
Thu, 30 Jul 2020 00:45:36 +0000 (20:45 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Thu, 30 Jul 2020 00:45:36 +0000 (20:45 -0400)
commit5fd7257cda8189bf41a86f62eb48aa1da2187009
tree6f0578d01a706d9d0fe0b0d15cbfc601faedcf51
parent91a52fbc0f3cb31086af6eb65a9661c94ba07278
xfs_io: Make -D and -R options incompatible explicitly

-D and -R options are mutually exclusive actually but many commands
can accept them at the same time and process them differently(e.g.
chattr alway chooses -D option or cowextsize accepts the last one
specified), so make these commands have the consistent behavior that
don't accept them concurrently.

1) Make them incompatible by setting argmax to 1 if commands can accept
   single option(i.e. lsattr, lsproj).
2) Make them incompatible by adding check if commands can accept multiple
   options(i.e. chattr, chproj, extsize, cowextsize).

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
io/attr.c
io/cowextsize.c
io/open.c