IOCTL-XFS-GOINGDOWN(2)

๐Ÿ’ฅ ioctl_xfs_goingdown โ€” shut down an XFS filesystem ๐Ÿ’ฅ

ok so bestie. this is a page from the System Calls Manual, and it's called ioctl_xfs_goingdown. yeah. it does exactly what it sounds like. sit down, we're gonna talk about it ๐Ÿซถ


โœจ NAME โœจ

ioctl_xfs_goingdown โ€” shut down an XFS filesystem


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

#include <xfs/xfs_fs.h>

int ioctl(int fd, XFS_IOC_GOINGDOWN, uint32_t flags);

๐Ÿ’… DESCRIPTION ๐Ÿ’…

ok so this call shuts down a live XFS filesystem. like, a running one. no cap. ๐Ÿซ 

this is a software initiated hard shutdown and honestly? it should be avoided whenever possible. that's not me being dramatic, that's the manpage being dramatic, and it's right. ๐Ÿ”ฅ

the way that after this call completes, the filesystem will be totally unusable until the filesystem has been unmounted and remounted. totally. unusable. not "a little weird", not "needs a minute" โ€” unusable. periodt. ๐Ÿ’€

so flags can be one of these:

  • XFS_FSOP_GOING_FLAGS_DEFAULT โ€” flush all dirty data and metadata to disk, flush pending transactions to the log, and then shut down. the responsible queen option ๐Ÿ‘‘
  • XFS_FSOP_GOING_FLAGS_LOGFLUSH โ€” flush all pending metadata transactions to the log and shut down, leaving all dirty data unwritten. so the metadata's fine but your data is justโ€ฆ out there. vibing. unwritten. ๐Ÿ™ˆ
  • XFS_FSOP_GOING_FLAGS_NOLOGFLUSH โ€” shut down immediately, without writing pending transactions or dirty data to disk. no warning, no goodbye, just chaos. main character exit fr fr ๐Ÿงš

๐Ÿ”ฎ RETURN VALUE ๐Ÿ”ฎ

if something goes wrong, -1 gets returned, and errno is set to tell you which error it was. classic.


๐Ÿ˜ญ ERRORS ๐Ÿ˜ญ

the error codes can be one of, but are not limited to, the following:

  • EFSBADCRC โ€” metadata checksum validation failed while performing the query. the checksum said ๐Ÿ’€
  • EFSCORRUPTED โ€” metadata corruption was encountered while performing the query. something in there is broken broken.
  • EIO โ€” an I/O error was encountered while performing the query. the disk said "not today".
  • EPERM โ€” caller did not have permission to shut down the filesystem. bestie you don't have the keys to this house ๐Ÿšช

๐ŸŒˆ CONFORMING TO ๐ŸŒˆ

this API is specific to XFS filesystem on the Linux kernel. it's an XFS thing, it's a Linux kernel thing, that's the whole story. iykyk โญ


๐ŸŒธ SEE ALSO ๐ŸŒธ


ok that's the whole page bestie, you're officially educated ๐Ÿ’œ

this was XFS, dated 2019-06-17, and the page itself is IOCTL-XFS-GOINGDOWN(2). love that for us. now go flush something responsibly, and please, for the love of everything, don't call this on a filesystem you actually like ๐ŸŽ€โœจ

๐Ÿ“ฆ where this page comes from