* [PATCH] xfs: don't skip rtmount when there's a realtime device
@ 2018-12-13 1:24 Darrick J. Wong
2018-12-13 19:06 ` Bill O'Donnell
2018-12-13 21:29 ` Eric Sandeen
0 siblings, 2 replies; 4+ messages in thread
From: Darrick J. Wong @ 2018-12-13 1:24 UTC (permalink / raw)
To: xfs
From: Darrick J. Wong <darrick.wong@oracle.com>
Don't ever skip the realtime bitmap / summary inode initialization if
there's a realtime device attached, because we'd rather fail the mount
if iget declines to retrieve a NULL inode pointer. Right now, if
someone sets rbmino to NULLFSINO on a rt-capable filesystem, mounts it,
and writes a file to the rt device, we'll blow up.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
fs/xfs/xfs_rtalloc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
index aefd63d46397..18ad31ded0bf 100644
--- a/fs/xfs/xfs_rtalloc.c
+++ b/fs/xfs/xfs_rtalloc.c
@@ -1206,7 +1206,8 @@ xfs_rtmount_inodes(
xfs_sb_t *sbp;
sbp = &mp->m_sb;
- if (sbp->sb_rbmino == NULLFSINO)
+ if (!xfs_sb_version_hasrealtime(&mp->m_sb) &&
+ sbp->sb_rbmino == NULLFSINO)
return 0;
error = xfs_iget(mp, NULL, sbp->sb_rbmino, 0, 0, &mp->m_rbmip);
if (error)
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] xfs: don't skip rtmount when there's a realtime device
2018-12-13 1:24 [PATCH] xfs: don't skip rtmount when there's a realtime device Darrick J. Wong
@ 2018-12-13 19:06 ` Bill O'Donnell
2018-12-13 21:29 ` Eric Sandeen
1 sibling, 0 replies; 4+ messages in thread
From: Bill O'Donnell @ 2018-12-13 19:06 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: xfs
On Wed, Dec 12, 2018 at 05:24:36PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Don't ever skip the realtime bitmap / summary inode initialization if
> there's a realtime device attached, because we'd rather fail the mount
> if iget declines to retrieve a NULL inode pointer. Right now, if
> someone sets rbmino to NULLFSINO on a rt-capable filesystem, mounts it,
> and writes a file to the rt device, we'll blow up.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
Makes sense.
Reviewed-by: Bill O'Donnell <billodo@redhat.com>
> fs/xfs/xfs_rtalloc.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
> index aefd63d46397..18ad31ded0bf 100644
> --- a/fs/xfs/xfs_rtalloc.c
> +++ b/fs/xfs/xfs_rtalloc.c
> @@ -1206,7 +1206,8 @@ xfs_rtmount_inodes(
> xfs_sb_t *sbp;
>
> sbp = &mp->m_sb;
> - if (sbp->sb_rbmino == NULLFSINO)
> + if (!xfs_sb_version_hasrealtime(&mp->m_sb) &&
> + sbp->sb_rbmino == NULLFSINO)
> return 0;
> error = xfs_iget(mp, NULL, sbp->sb_rbmino, 0, 0, &mp->m_rbmip);
> if (error)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] xfs: don't skip rtmount when there's a realtime device
2018-12-13 1:24 [PATCH] xfs: don't skip rtmount when there's a realtime device Darrick J. Wong
2018-12-13 19:06 ` Bill O'Donnell
@ 2018-12-13 21:29 ` Eric Sandeen
2018-12-13 23:46 ` Darrick J. Wong
1 sibling, 1 reply; 4+ messages in thread
From: Eric Sandeen @ 2018-12-13 21:29 UTC (permalink / raw)
To: Darrick J. Wong, xfs
On 12/12/18 7:24 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Don't ever skip the realtime bitmap / summary inode initialization if
> there's a realtime device attached, because we'd rather fail the mount
> if iget declines to retrieve a NULL inode pointer. Right now, if
> someone sets rbmino to NULLFSINO on a rt-capable filesystem, mounts it,
> and writes a file to the rt device, we'll blow up.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
> fs/xfs/xfs_rtalloc.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
> index aefd63d46397..18ad31ded0bf 100644
> --- a/fs/xfs/xfs_rtalloc.c
> +++ b/fs/xfs/xfs_rtalloc.c
> @@ -1206,7 +1206,8 @@ xfs_rtmount_inodes(
> xfs_sb_t *sbp;
>
> sbp = &mp->m_sb;
> - if (sbp->sb_rbmino == NULLFSINO)
> + if (!xfs_sb_version_hasrealtime(&mp->m_sb) &&
> + sbp->sb_rbmino == NULLFSINO)
> return 0;
> error = xfs_iget(mp, NULL, sbp->sb_rbmino, 0, 0, &mp->m_rbmip);
> if (error)
>
Seems fine as far as it goes, but now we have this weird situation where for
a filesystem without the realtime feature, we'll just skip this part and
mount if sb_rbmino is NULL, but if sb_rsumino is NULL, we'll fail the iget
and fail the mount.
So while there's noting really wrong with the fix, it seems like it could all
be made a bit more consistent while you're here. (classic move by me!) ;)
-Eric
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] xfs: don't skip rtmount when there's a realtime device
2018-12-13 21:29 ` Eric Sandeen
@ 2018-12-13 23:46 ` Darrick J. Wong
0 siblings, 0 replies; 4+ messages in thread
From: Darrick J. Wong @ 2018-12-13 23:46 UTC (permalink / raw)
To: Eric Sandeen; +Cc: xfs
On Thu, Dec 13, 2018 at 03:29:54PM -0600, Eric Sandeen wrote:
>
>
> On 12/12/18 7:24 PM, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> >
> > Don't ever skip the realtime bitmap / summary inode initialization if
> > there's a realtime device attached, because we'd rather fail the mount
> > if iget declines to retrieve a NULL inode pointer. Right now, if
> > someone sets rbmino to NULLFSINO on a rt-capable filesystem, mounts it,
> > and writes a file to the rt device, we'll blow up.
> >
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> > fs/xfs/xfs_rtalloc.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
> > index aefd63d46397..18ad31ded0bf 100644
> > --- a/fs/xfs/xfs_rtalloc.c
> > +++ b/fs/xfs/xfs_rtalloc.c
> > @@ -1206,7 +1206,8 @@ xfs_rtmount_inodes(
> > xfs_sb_t *sbp;
> >
> > sbp = &mp->m_sb;
> > - if (sbp->sb_rbmino == NULLFSINO)
> > + if (!xfs_sb_version_hasrealtime(&mp->m_sb) &&
> > + sbp->sb_rbmino == NULLFSINO)
> > return 0;
> > error = xfs_iget(mp, NULL, sbp->sb_rbmino, 0, 0, &mp->m_rbmip);
> > if (error)
> >
>
> Seems fine as far as it goes, but now we have this weird situation where for
> a filesystem without the realtime feature, we'll just skip this part and
> mount if sb_rbmino is NULL, but if sb_rsumino is NULL, we'll fail the iget
> and fail the mount.
>
> So while there's noting really wrong with the fix, it seems like it could all
> be made a bit more consistent while you're here. (classic move by me!) ;)
Hmm. Well if there /aren't supposed/ to be any XFSes out there with
garbage/null realtime bitmap / summary inodes, then I'm happy to get rid
of the "if (sbp->sb_rbmino == NULLFSINO) return 0;" logic. The current
logic is sorta weird, but I don't know if that was a deliberate design
decision or just a logic bug that needs to go away.
Though now that I see that we can indeed add a realtime section to a
filesystem that didn't previously have one, I guess I should go look at
the rtrmapbt growfs code a little more closely.
--D
> -Eric
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-12-13 23:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-13 1:24 [PATCH] xfs: don't skip rtmount when there's a realtime device Darrick J. Wong
2018-12-13 19:06 ` Bill O'Donnell
2018-12-13 21:29 ` Eric Sandeen
2018-12-13 23:46 ` Darrick J. Wong
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.