If someone runs mkfs with rtinherit=1, a realtime volume configured, and
a protofile that creates a regular file in the filesystem, mkfs will
error out with "Function not implemented" because userspace doesn't know
how to allocate extents from the rt bitmap. Catch this specific case
and hand back a somewhat nicer explanation of what happened.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
nb = XFS_B_TO_FSB(mp, len);
nmap = 1;
error = -libxfs_bmapi_write(tp, ip, 0, nb, 0, nb, &map, &nmap);
+ if (error == ENOSYS && XFS_IS_REALTIME_INODE(ip)) {
+ fprintf(stderr,
+ _("%s: creating realtime files from proto file not supported.\n"),
+ progname);
+ exit(1);
+ }
if (error) {
fail(_("error allocating space for a file"), error);
}