Fix bugs in mdsyncfiletag().
Fix bugs in mdsyncfiletag().

Commit 3eb77eba moved a _mdfd_getseg() call from mdsync() into a new
callback function mdsyncfiletag(), but didn't get the arguments quite
right.  Without the EXTENSION_DONT_CHECK_SIZE flag we fail to open a
segment if lower-numbered segments have been truncated, and it wants
a block number rather than a segment number.

While comparing with the older coding, also remove an unnecessary
clobbering of errno, and adjust the code in mdunlinkfiletag() to
ressemble the original code from mdpostckpt() more closely instead
of using an unnecessary call to smgropen().

Author: Thomas Munro
Discussion: https://postgr.es/m/CA%2BhUKGL%2BYLUOA0eYiBXBfwW%2BbH5kFgh94%3DgQH0jHEJ-t5Y91wQ%40mail.gmail.com

lisakowen/gpdb,xinzweb/gpdb,lisakowen/gpdb,xinzweb/gpdb,greenplum-db/gpdb,50wu/gpdb,xinzweb/gpdb,adam8157/gpdb,50wu/gpdb,greenplum-db/gpdb,adam8157/gpdb,adam8157/gpdb,xinzweb/gpdb,greenplum-db/gpdb,lisakowen/gpdb,adam8157/gpdb,50wu/gpdb,adam8157/gpdb,lisakowen/gpdb,xinzweb/gpdb,greenplum-db/gpdb,adam8157/gpdb,greenplum-db/gpdb,lisakowen/gpdb,50wu/gpdb,50wu/gpdb,xinzweb/gpdb,greenplum-db/gpdb,adam8157/gpdb,50wu/gpdb,xinzweb/gpdb,50wu/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,xinzweb/gpdb,adam8157/gpdb,lisakowen/gpdb,lisakowen/gpdb,50wu/gpdb,lisakowen/gpdb