xfs
[Top] [All Lists]

[PATCH 2/4] xfs: fix xfs_get_extsz_hint for a zero extent size hint

To: xfs@xxxxxxxxxxx
Subject: [PATCH 2/4] xfs: fix xfs_get_extsz_hint for a zero extent size hint
From: kdasu <kdasu.kdev@xxxxxxxxx>
Date: Fri, 17 Feb 2012 14:55:49 -0800 (PST)
In-reply-to: <33346009.post@xxxxxxxxxxxxxxx>
References: <33345988.post@xxxxxxxxxxxxxxx> <33346009.post@xxxxxxxxxxxxxxx>
We can easily set the extsize flag without setting an extent size
hint, or one that evaluates to zero.  Historically the di_extsize
field was only used when it was non-zero, but the commit

        "Cleanup inode extent size hint extraction"

broke this.  Restore the old behaviour, thus fixing xfsqa 090 with
a debug kernel.

Signed-off-by: Christoph Hellwig <hch@xxxxxx>
Signed-off-by: Alex Elder <aelder@xxxxxxx>
Signed-off-by: Kamal Dasu <kdasu.kdev@xxxxxxxxx>
---
 fs/xfs/xfs_rw.c |   18 +++++-------------
 1 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/fs/xfs/xfs_rw.c b/fs/xfs/xfs_rw.c
index 56861d5..ccd3adf 100644
--- a/fs/xfs/xfs_rw.c
+++ b/fs/xfs/xfs_rw.c
@@ -173,17 +173,9 @@ xfs_extlen_t
 xfs_get_extsz_hint(
        struct xfs_inode        *ip)
 {
-       xfs_extlen_t            extsz;
-
-       if (unlikely(XFS_IS_REALTIME_INODE(ip))) {
-               extsz = (ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE)
-                               ? ip->i_d.di_extsize
-                               : ip->i_mount->m_sb.sb_rextsize;
-               ASSERT(extsz);
-       } else {
-               extsz = (ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE)
-                               ? ip->i_d.di_extsize : 0;
-       }
-
-       return extsz;
+       if ((ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE) && ip->i_d.di_extsize)
+               return ip->i_d.di_extsize;
+       if (XFS_IS_REALTIME_INODE(ip))
+               return ip->i_mount->m_sb.sb_rextsize;
+       return 0;
 }
-- 
1.7.5.4

-- 
View this message in context: 
http://old.nabble.com/-PATCH-0-4--xfs%3A-resurrect-realtime-subvolume-support-on-kernel-2.6.37-tp33345988p33346035.html
Sent from the Xfs - General mailing list archive at Nabble.com.

<Prev in Thread] Current Thread [Next in Thread>