common/xfs: Check if write supports [-c|-d] option in xfs_db
authorxiao yang <yangx.jy@cn.fujitsu.com>
Tue, 16 Jan 2018 07:26:55 +0000 (15:26 +0800)
committerEryu Guan <eguan@redhat.com>
Fri, 19 Jan 2018 03:01:44 +0000 (11:01 +0800)
commite33b0351dae375105680dd70582a43ad89ac4bb8
tree0ddefae2d12eee52d48d5958333942512d34cf57
parent1ee97207dce2db8c36f592c6853d19a7c010e3d1
common/xfs: Check if write supports [-c|-d] option in xfs_db

Make sure _scratch_xfs_set_metadata_field() can be used on an
old xfsprogs-dev(e.g. v3.1.1).

The "-d" option was introduced since xfsprogs-dev v4.7.0 by commit
86769b3 ("xfs_db: allow recalculating CRCs on invalid metadata").

The special argument "--" is only used to end option-scanning
in getopt().  getopt() was introduced since xfsprogs-dev v3.2.3 by
commit c9f5e3d ("xfs_db: Allow writes of corrupted data")'.

Signed-off-by: xiao yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
common/xfs