Message ID | 160013468391.2932378.13825727040727340226.stgit@magnolia (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | xfsprogs: even more fixes for 5.9 | expand |
On Mon, Sep 14, 2020 at 06:51:23PM -0700, Darrick J. Wong wrote: > From: Darrick J. Wong <darrick.wong@oracle.com> > > 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. Would this be so hard to fix?
On Thu, Sep 17, 2020 at 09:02:34AM +0100, Christoph Hellwig wrote: > On Mon, Sep 14, 2020 at 06:51:23PM -0700, Darrick J. Wong wrote: > > From: Darrick J. Wong <darrick.wong@oracle.com> > > > > 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. > > Would this be so hard to fix? Probably not, but I'd prefer to see users asking for this feature before porting more code to userspace. I guess I could take a look for 5.10, maybe it's not that difficult. Though given the amount of bitrot and math errors I've seen recently, I get the funny sense that my crash test box and TV are the only things using rt support. --D
On 9/14/20 8:51 PM, Darrick J. Wong wrote: > From: Darrick J. Wong <darrick.wong@oracle.com> > > 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> hch has a point about "maybe we should fix it" but it seems like it's not somewhere we really need to spend development effort right now. Reviewed-by: Eric Sandeen <sandeen@redhat.com> > --- > mkfs/proto.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > > diff --git a/mkfs/proto.c b/mkfs/proto.c > index 9db8fe2d6447..20a7cc3bb5d5 100644 > --- a/mkfs/proto.c > +++ b/mkfs/proto.c > @@ -244,6 +244,12 @@ newfile( > 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); > } >
diff --git a/mkfs/proto.c b/mkfs/proto.c index 9db8fe2d6447..20a7cc3bb5d5 100644 --- a/mkfs/proto.c +++ b/mkfs/proto.c @@ -244,6 +244,12 @@ newfile( 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); }