Skip to contentSkip to conversation

xfsprogs: a couple metadump fixes and sb logging backports

PATCH In review Brian Foster 2 participants 6 messages Feb 23, 2015

lore
Share & tools
lore
#0 lore raw

cover xfsprogs: a couple metadump fixes and sb logging backports

Hi all,

Patches 1 and 2 are a couple metadump fixes that fell out from playing around with large block size filesystems (e.g., 64k on ppc64), similar to the repair patches I had sent recently. Patches 3 and 4 are backports of a couple of the sb logging rework fixes.

Dave,

I'm not sure what the workflow here is wrt to the sb logging backports. FWIW, these are the only patches I need on top of the libxfs-3.19-update branch to get most of the sparse inode bits to backport cleanly. Do you want to include them in that branch? Otherwise, I'll just keep them in my sparse inodes branch for now.

Brian

Brian Foster (4):
metadump: include NULLFSINO check in inode copy code
metadump: check for non-zero inode alignment
xfsprogs: remove bitfield based superblock updates
xfsprogs: consolidate superblock logging functions

 db/metadump.c                    |   3 +-
 db/sb.c                          |   9 +-
 libxfs/support/libxfs_api_defs.h |   2 +-
 libxfs/support/trans.c           |   2 +-
 libxfs/xfs_attr_leaf.c           |   2 +-
 libxfs/xfs_bmap.c                |  14 +-
 libxfs/xfs_sb.c                  | 286 ++++++++++++++-------------------------
 libxfs/xfs_sb.h                  |  11 +-
 libxfs/xfs_shared.h              |  33 ++---
 libxfs/xfs_trans_resv.c          |  14 --
 libxfs/xfs_trans_resv.h          |   1 -
 mdrestore/xfs_mdrestore.c        |   2 +-
 mkfs/proto.c                     |   6 +-
 mkfs/xfs_mkfs.c                  |   4 +-
 repair/phase5.c                  |   2 +-
 repair/sb.c                      |   2 +-
 repair/scan.c                    |   2 +-
 17 files changed, 144 insertions(+), 251 deletions(-)
Signature · 6 lines
1.9.3

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#1 lore raw

PATCH 1/4 metadump: include NULLFSINO check in inode copy code

The copy_ino() function includes a check for effectively NULL inode numbers. It checks for 0 but does not include NULLFSINO. This leads to spurious warnings in some instances. For example, copy_ino() is called unconditionally for sb quota inodes from copy_sb_inodes(), values of which can be NULLFSINO.

Check for NULLFSINO and return quietly from copy_ino().

---
 db/metadump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
db/metadump.c +1 -1
index 3eafac6..604fcf4 100644
@@ -2112,7 +2112,7 @@ copy_ino(
 	int			offset;
 	int			rval = 0;
 
-	if (ino == 0)
+	if (ino == 0 || ino == NULLFSINO)
 		return 1;
 
 	agno = XFS_INO_TO_AGNO(mp, ino);
Signature · 6 lines
1.9.3

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#2 lore raw

PATCH 2/4 metadump: check for non-zero inode alignment

In reply to Brian Foster

The copy_inode_chunk() function performs some basic sanity checks on the inode record, block number, etc. One of these checks includes whether the inode chunk is aligned according to sb_inoalignmt. sb_inoalignment can equal 0 with larger block sizes. This results in a mod-by-zero, "badly aligned inode ..." warnings and skipped inodes in metadump images. This can be reproduced with a '-m crc=1,finobt=1 -b size=64k' fs on ppc64.

Update copy_inode_chunk() to only enforce the inode alignment check when sb_inoalignmt is non-zero.

---
 db/metadump.c | 1 +
 1 file changed, 1 insertion(+)
db/metadump.c +1 -0
index 604fcf4..94f92bc 100644
@@ -1865,6 +1865,7 @@ copy_inode_chunk(
 			(mp->m_sb.sb_inopblock > XFS_INODES_PER_CHUNK &&
 					off % XFS_INODES_PER_CHUNK != 0) ||
 			(xfs_sb_version_hasalign(&mp->m_sb) &&
+					mp->m_sb.sb_inoalignmt != 0 &&
 					agbno % mp->m_sb.sb_inoalignmt != 0)) {
 		if (show_warnings)
 			print_warning("badly aligned inode (start = %llu)",
Signature · 6 lines
1.9.3

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#3 lore raw

PATCH 3/4 xfsprogs: remove bitfield based superblock updates

In reply to Brian Foster

This is a backport of the following kernel commit:

4d11a4023940 xfs: remove bitfield based superblock updates

... which kills the per-field superblock logging mechanism in shared libxfs code. Also update the callers of the old code throughout xfsprogs to no longer pass the associated bitfield logging parameter to the updated libxfs_sb_to_disk() and xfs_mod_sb() functions.

---
 db/sb.c                   |   9 +-
 libxfs/support/trans.c    |   2 +-
 libxfs/xfs_attr_leaf.c    |   2 +-
 libxfs/xfs_bmap.c         |  14 +--
 libxfs/xfs_sb.c           | 277 ++++++++++++++++------------------------------
 libxfs/xfs_sb.h           |  10 +-
 mdrestore/xfs_mdrestore.c |   2 +-
 mkfs/proto.c              |   6 +-
 mkfs/xfs_mkfs.c           |   4 +-
 repair/phase5.c           |   2 +-
 repair/sb.c               |   2 +-
 repair/scan.c             |   2 +-
 12 files changed, 121 insertions(+), 211 deletions(-)
db/sb.c +3 -6
index 38f74f8..1b8b6d5 100644
@@ -335,7 +335,7 @@ do_uuid(xfs_agnumber_t agno, uuid_t *uuid)
 	}
 	/* set uuid */
 	memcpy(&tsb.sb_uuid, uuid, sizeof(uuid_t));
-	libxfs_sb_to_disk(iocur_top->data, &tsb, XFS_SB_UUID);
+	libxfs_sb_to_disk(iocur_top->data, &tsb);
 	write_cur();
 	return uuid;
 }
@@ -488,7 +488,7 @@ do_label(xfs_agnumber_t agno, char *label)
 	memset(&tsb.sb_fname, 0, sizeof(tsb.sb_fname));
 	memcpy(&tsb.sb_fname, label, len);
 	memcpy(&lbl[0], &tsb.sb_fname, sizeof(tsb.sb_fname));
-	libxfs_sb_to_disk(iocur_top->data, &tsb, XFS_SB_FNAME);
+	libxfs_sb_to_disk(iocur_top->data, &tsb);
 	write_cur();
 	return &lbl[0];
 }
@@ -569,7 +569,6 @@ static int
 do_version(xfs_agnumber_t agno, __uint16_t version, __uint32_t features)
 {
 	xfs_sb_t	tsb;
-	__int64_t	fields = 0;
 
 	if (!get_sb(agno, &tsb))
 		return 0;
@@ -583,14 +582,12 @@ do_version(xfs_agnumber_t agno, __uint16_t version, __uint32_t features)
 	if ((version & XFS_SB_VERSION_LOGV2BIT) &&
 					!xfs_sb_version_haslogv2(&tsb)) {
 		tsb.sb_logsunit = 1;
-		fields |= (1LL << XFS_SBS_LOGSUNIT);
 	}
 
 	tsb.sb_versionnum = version;
 	tsb.sb_features2 = features;
 	tsb.sb_bad_features2 = features;
-	fields |= XFS_SB_VERSIONNUM | XFS_SB_FEATURES2 | XFS_SB_BAD_FEATURES2;
-	libxfs_sb_to_disk(iocur_top->data, &tsb, fields);
+	libxfs_sb_to_disk(iocur_top->data, &tsb);
 	write_cur();
 	return 1;
 }
libxfs/support/trans.c +1 -1
index 2447764..bf13127 100644
@@ -845,7 +845,7 @@ libxfs_trans_commit(
 			sbp->sb_fdblocks += tp->t_fdblocks_delta;
 		if (tp->t_frextents_delta)
 			sbp->sb_frextents += tp->t_frextents_delta;
-		xfs_mod_sb(tp, XFS_SB_ALL_BITS);
+		xfs_mod_sb(tp);
 	}
 
 #ifdef XACT_DEBUG
libxfs/xfs_attr_leaf.c +1 -1
index 714c257..8d38a04 100644
@@ -399,7 +399,7 @@ xfs_sbversion_add_attr2(xfs_mount_t *mp, xfs_trans_t *tp)
 		if (!xfs_sb_version_hasattr2(&mp->m_sb)) {
 			xfs_sb_version_addattr2(&mp->m_sb);
 			spin_unlock(&mp->m_sb_lock);
-			xfs_mod_sb(tp, XFS_SB_VERSIONNUM | XFS_SB_FEATURES2);
+			xfs_mod_sb(tp);
 		} else
 			spin_unlock(&mp->m_sb_lock);
 	}
libxfs/xfs_bmap.c +6 -8
index c4e9da6..cf500a6 100644
@@ -1213,22 +1213,20 @@ xfs_bmap_add_attrfork(
 		goto bmap_cancel;
 	if (!xfs_sb_version_hasattr(&mp->m_sb) ||
 	   (!xfs_sb_version_hasattr2(&mp->m_sb) && version == 2)) {
-		__int64_t sbfields = 0;
+		bool mod_sb = false;
 
 		spin_lock(&mp->m_sb_lock);
 		if (!xfs_sb_version_hasattr(&mp->m_sb)) {
 			xfs_sb_version_addattr(&mp->m_sb);
-			sbfields |= XFS_SB_VERSIONNUM;
+			mod_sb = true;
 		}
 		if (!xfs_sb_version_hasattr2(&mp->m_sb) && version == 2) {
 			xfs_sb_version_addattr2(&mp->m_sb);
-			sbfields |= (XFS_SB_VERSIONNUM | XFS_SB_FEATURES2);
+			mod_sb = true;
 		}
-		if (sbfields) {
-			spin_unlock(&mp->m_sb_lock);
-			xfs_mod_sb(tp, sbfields);
-		} else
-			spin_unlock(&mp->m_sb_lock);
+		spin_unlock(&mp->m_sb_lock);
+		if (mod_sb)
+			xfs_mod_sb(tp);
 	}
 
 	error = xfs_bmap_finish(&tp, &flist, &committed);
libxfs/xfs_sb.c +96 -181

321 lines not on this page · raw message

libxfs/xfs_sb.h +5 -5
index 8eb1c54..e193caa 100644
@@ -27,11 +27,11 @@ extern struct xfs_perag *xfs_perag_get_tag(struct xfs_mount *, xfs_agnumber_t,
 extern void	xfs_perag_put(struct xfs_perag *pag);
 extern int	xfs_initialize_perag_data(struct xfs_mount *, xfs_agnumber_t);
 
-extern void	xfs_sb_calc_crc(struct xfs_buf	*);
-extern void	xfs_mod_sb(struct xfs_trans *, __int64_t);
-extern void	xfs_sb_mount_common(struct xfs_mount *, struct xfs_sb *);
-extern void	xfs_sb_from_disk(struct xfs_sb *, struct xfs_dsb *);
-extern void	xfs_sb_to_disk(struct xfs_dsb *, struct xfs_sb *, __int64_t);
+extern void	xfs_sb_calc_crc(struct xfs_buf *bp);
+extern void	xfs_mod_sb(struct xfs_trans *tp);
+extern void	xfs_sb_mount_common(struct xfs_mount *mp, struct xfs_sb *sbp);
+extern void	xfs_sb_from_disk(struct xfs_sb *to, struct xfs_dsb *from);
+extern void	xfs_sb_to_disk(struct xfs_dsb *to, struct xfs_sb *from);
 extern void	xfs_sb_quota_from_disk(struct xfs_sb *sbp);
 
 #endif	/* __XFS_SB_H__ */
mdrestore/xfs_mdrestore.c +1 -1
index e57bdb2..f3c846e 100644
@@ -168,7 +168,7 @@ perform_restore(
 
 	memset(block_buffer, 0, sb.sb_sectsize);
 	sb.sb_inprogress = 0;
-	libxfs_sb_to_disk((xfs_dsb_t *)block_buffer, &sb, XFS_SB_ALL_BITS);
+	libxfs_sb_to_disk((xfs_dsb_t *)block_buffer, &sb);
 	if (xfs_sb_version_hascrc(&sb)) {
 		xfs_update_cksum(block_buffer, sb.sb_sectsize,
 				 offsetof(struct xfs_sb, sb_crc));
mkfs/proto.c +3 -3
index 0c8bd2f..18a2553 100644
@@ -551,7 +551,7 @@ parseproto(
 		if (!pip) {
 			pip = ip;
 			mp->m_sb.sb_rootino = ip->i_ino;
-			libxfs_mod_sb(tp, XFS_SB_ROOTINO);
+			libxfs_mod_sb(tp);
 			isroot = 1;
 		} else {
 			libxfs_trans_ijoin(tp, pip, 0);
@@ -657,7 +657,7 @@ rtinit(
 	rbmip->i_d.di_flags = XFS_DIFLAG_NEWRTBM;
 	*(__uint64_t *)&rbmip->i_d.di_atime = 0;
 	libxfs_trans_log_inode(tp, rbmip, XFS_ILOG_CORE);
-	libxfs_mod_sb(tp, XFS_SB_RBMINO);
+	libxfs_mod_sb(tp);
 	mp->m_rbmip = rbmip;
 	error = -libxfs_inode_alloc(&tp, NULL, S_IFREG, 1, 0,
 					&creds, &fsxattrs, &rsumip);
@@ -667,7 +667,7 @@ rtinit(
 	mp->m_sb.sb_rsumino = rsumip->i_ino;
 	rsumip->i_d.di_size = mp->m_rsumsize;
 	libxfs_trans_log_inode(tp, rsumip, XFS_ILOG_CORE);
-	libxfs_mod_sb(tp, XFS_SB_RSUMINO);
+	libxfs_mod_sb(tp);
 	libxfs_trans_commit(tp, 0);
 	mp->m_rsumip = rsumip;
 	/*
mkfs/xfs_mkfs.c +2 -2
index d4856b1..176a6b2 100644
@@ -2651,7 +2651,7 @@ _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"),
 	buf = libxfs_getbuf(mp->m_ddev_targp, XFS_SB_DADDR, XFS_FSS_TO_BB(mp, 1));
 	buf->b_ops = &xfs_sb_buf_ops;
 	memset(XFS_BUF_PTR(buf), 0, sectorsize);
-	libxfs_sb_to_disk((void *)XFS_BUF_PTR(buf), sbp, XFS_SB_ALL_BITS);
+	libxfs_sb_to_disk((void *)XFS_BUF_PTR(buf), sbp);
 	libxfs_writebuf(buf, LIBXFS_EXIT_ON_FAILURE);
 	libxfs_purgebuf(buf);
 
@@ -2712,7 +2712,7 @@ _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"),
 				XFS_FSS_TO_BB(mp, 1));
 		buf->b_ops = &xfs_sb_buf_ops;
 		memset(XFS_BUF_PTR(buf), 0, sectorsize);
-		libxfs_sb_to_disk((void *)XFS_BUF_PTR(buf), sbp, XFS_SB_ALL_BITS);
+		libxfs_sb_to_disk((void *)XFS_BUF_PTR(buf), sbp);
 		libxfs_writebuf(buf, LIBXFS_EXIT_ON_FAILURE);
 
 		/*
repair/phase5.c +1 -1
index 71bf751..1ce57a1 100644
@@ -1500,7 +1500,7 @@ sync_sb(xfs_mount_t *mp)
 
 	update_sb_version(mp);
 
-	libxfs_sb_to_disk(XFS_BUF_TO_SBP(bp), &mp->m_sb, XFS_SB_ALL_BITS);
+	libxfs_sb_to_disk(XFS_BUF_TO_SBP(bp), &mp->m_sb);
 	libxfs_writebuf(bp, 0);
 }
 
repair/sb.c +1 -1
index 79f7882..c85b9e2 100644
@@ -434,7 +434,7 @@ write_primary_sb(xfs_sb_t *sbp, int size)
 		do_error(_("couldn't seek to offset 0 in filesystem\n"));
 	}
 
-	libxfs_sb_to_disk(buf, sbp, XFS_SB_ALL_BITS);
+	libxfs_sb_to_disk(buf, sbp);
 
 	if (xfs_sb_version_hascrc(sbp))
 		xfs_update_cksum((char *)buf, size, XFS_SB_CRC_OFF);
repair/scan.c +1 -1
index ebc8535..259ab40 100644
@@ -1597,7 +1597,7 @@ scan_ag(
 	if (sb_dirty && !no_modify) {
 		if (agno == 0)
 			memcpy(&mp->m_sb, sb, sizeof(xfs_sb_t));
-		libxfs_sb_to_disk(XFS_BUF_TO_SBP(sbbuf), sb, XFS_SB_ALL_BITS);
+		libxfs_sb_to_disk(XFS_BUF_TO_SBP(sbbuf), sb);
 		libxfs_writebuf(sbbuf, 0);
 	} else
 		libxfs_putbuf(sbbuf);
Signature · 6 lines
1.9.3

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#4 lore raw

PATCH 4/4 xfsprogs: consolidate superblock logging functions

In reply to Brian Foster

This is a backport of the following kernel commit:

61e63ecb577f xfs: consolidate superblock logging functions

... which converts the xfs_mod_sb() function to xfs_log_sb(). The xfs_sync_sb() function uses a transaction interface not available in userspace. The former function is not required, so is dropped from the patch.

Also update callers of xfs_mod_sb() in mkfs to use xfs_log_sb().

---
 libxfs/support/libxfs_api_defs.h |  2 +-
 libxfs/support/trans.c           |  2 +-
 libxfs/xfs_attr_leaf.c           |  2 +-
 libxfs/xfs_bmap.c                | 10 +++++-----
 libxfs/xfs_sb.c                  | 11 +++++------
 libxfs/xfs_sb.h                  |  3 ++-
 libxfs/xfs_shared.h              | 33 +++++++++++++++------------------
 libxfs/xfs_trans_resv.c          | 14 --------------
 libxfs/xfs_trans_resv.h          |  1 -
 mkfs/proto.c                     |  6 +++---
 10 files changed, 33 insertions(+), 51 deletions(-)
libxfs/support/libxfs_api_defs.h +1 -1
index ebed749..4147df6 100644
@@ -99,7 +99,7 @@
 #define xfs_idestroy_fork		libxfs_idestroy_fork
 #define xfs_dinode_verify		libxfs_dinode_verify
 
-#define xfs_mod_sb			libxfs_mod_sb
+#define xfs_log_sb			libxfs_log_sb
 #define xfs_mod_incore_sb		libxfs_mod_incore_sb
 #define xfs_sb_from_disk		libxfs_sb_from_disk
 #define xfs_sb_quota_from_disk		libxfs_sb_quota_from_disk
libxfs/support/trans.c +1 -1
index bf13127..885c5f4 100644
@@ -845,7 +845,7 @@ libxfs_trans_commit(
 			sbp->sb_fdblocks += tp->t_fdblocks_delta;
 		if (tp->t_frextents_delta)
 			sbp->sb_frextents += tp->t_frextents_delta;
-		xfs_mod_sb(tp);
+		xfs_log_sb(tp);
 	}
 
 #ifdef XACT_DEBUG
libxfs/xfs_attr_leaf.c +1 -1
index 8d38a04..f3f70fb 100644
@@ -399,7 +399,7 @@ xfs_sbversion_add_attr2(xfs_mount_t *mp, xfs_trans_t *tp)
 		if (!xfs_sb_version_hasattr2(&mp->m_sb)) {
 			xfs_sb_version_addattr2(&mp->m_sb);
 			spin_unlock(&mp->m_sb_lock);
-			xfs_mod_sb(tp);
+			xfs_log_sb(tp);
 		} else
 			spin_unlock(&mp->m_sb_lock);
 	}
libxfs/xfs_bmap.c +5 -5
index cf500a6..09f0847 100644
@@ -1213,20 +1213,20 @@ xfs_bmap_add_attrfork(
 		goto bmap_cancel;
 	if (!xfs_sb_version_hasattr(&mp->m_sb) ||
 	   (!xfs_sb_version_hasattr2(&mp->m_sb) && version == 2)) {
-		bool mod_sb = false;
+		bool log_sb = false;
 
 		spin_lock(&mp->m_sb_lock);
 		if (!xfs_sb_version_hasattr(&mp->m_sb)) {
 			xfs_sb_version_addattr(&mp->m_sb);
-			mod_sb = true;
+			log_sb = true;
 		}
 		if (!xfs_sb_version_hasattr2(&mp->m_sb) && version == 2) {
 			xfs_sb_version_addattr2(&mp->m_sb);
-			mod_sb = true;
+			log_sb = true;
 		}
 		spin_unlock(&mp->m_sb_lock);
-		if (mod_sb)
-			xfs_mod_sb(tp);
+		if (log_sb)
+			xfs_log_sb(tp);
 	}
 
 	error = xfs_bmap_finish(&tp, &flist, &committed);
libxfs/xfs_sb.c +5 -6
index 05f0c94..cbd47d7 100644
@@ -736,14 +736,13 @@ xfs_initialize_perag_data(
 }
 
 /*
- * xfs_mod_sb() can be used to copy arbitrary changes to the
- * in-core superblock into the superblock buffer to be logged.
- * It does not provide the higher level of locking that is
- * needed to protect the in-core superblock from concurrent
- * access.
+ * xfs_log_sb() can be used to copy arbitrary changes to the in-core superblock
+ * into the superblock buffer to be logged.  It does not provide the higher
+ * level of locking that is needed to protect the in-core superblock from
+ * concurrent access.
  */
 void
-xfs_mod_sb(
+xfs_log_sb(
 	struct xfs_trans	*tp)
 {
 	struct xfs_mount	*mp = tp->t_mountp;
libxfs/xfs_sb.h +2 -1
index e193caa..b25bb9a 100644
@@ -28,7 +28,8 @@ extern void	xfs_perag_put(struct xfs_perag *pag);
 extern int	xfs_initialize_perag_data(struct xfs_mount *, xfs_agnumber_t);
 
 extern void	xfs_sb_calc_crc(struct xfs_buf *bp);
-extern void	xfs_mod_sb(struct xfs_trans *tp);
+extern void	xfs_log_sb(struct xfs_trans *tp);
+extern int	xfs_sync_sb(struct xfs_mount *mp, bool wait);
 extern void	xfs_sb_mount_common(struct xfs_mount *mp, struct xfs_sb *sbp);
 extern void	xfs_sb_from_disk(struct xfs_sb *to, struct xfs_dsb *from);
 extern void	xfs_sb_to_disk(struct xfs_dsb *to, struct xfs_sb *from);
libxfs/xfs_shared.h +15 -18
index 82404da..8dda4b3 100644
@@ -82,7 +82,7 @@ extern const struct xfs_buf_ops xfs_symlink_buf_ops;
 #define	XFS_TRANS_ATTR_RM		23
 #define	XFS_TRANS_ATTR_FLAG		24
 #define	XFS_TRANS_CLEAR_AGI_BUCKET	25
-#define XFS_TRANS_QM_SBCHANGE		26
+#define XFS_TRANS_SB_CHANGE		26
 /*
  * Dummy entries since we use the transaction type to index into the
  * trans_type[] in xlog_recover_print_trans_head()
@@ -95,17 +95,15 @@ extern const struct xfs_buf_ops xfs_symlink_buf_ops;
 #define XFS_TRANS_QM_DQCLUSTER		32
 #define XFS_TRANS_QM_QINOCREATE		33
 #define XFS_TRANS_QM_QUOTAOFF_END	34
-#define XFS_TRANS_SB_UNIT		35
-#define XFS_TRANS_FSYNC_TS		36
-#define	XFS_TRANS_GROWFSRT_ALLOC	37
-#define	XFS_TRANS_GROWFSRT_ZERO		38
-#define	XFS_TRANS_GROWFSRT_FREE		39
-#define	XFS_TRANS_SWAPEXT		40
-#define	XFS_TRANS_SB_COUNT		41
-#define	XFS_TRANS_CHECKPOINT		42
-#define	XFS_TRANS_ICREATE		43
-#define	XFS_TRANS_CREATE_TMPFILE	44
-#define	XFS_TRANS_TYPE_MAX		44
+#define XFS_TRANS_FSYNC_TS		35
+#define	XFS_TRANS_GROWFSRT_ALLOC	36
+#define	XFS_TRANS_GROWFSRT_ZERO		37
+#define	XFS_TRANS_GROWFSRT_FREE		38
+#define	XFS_TRANS_SWAPEXT		39
+#define	XFS_TRANS_CHECKPOINT		40
+#define	XFS_TRANS_ICREATE		41
+#define	XFS_TRANS_CREATE_TMPFILE	42
+#define	XFS_TRANS_TYPE_MAX		43
 /* new transaction types need to be reflected in xfs_logprint(8) */
 
 #define XFS_TRANS_TYPES \
@@ -113,7 +111,6 @@ extern const struct xfs_buf_ops xfs_symlink_buf_ops;
 	{ XFS_TRANS_SETATTR_SIZE,	"SETATTR_SIZE" }, \
 	{ XFS_TRANS_INACTIVE,		"INACTIVE" }, \
 	{ XFS_TRANS_CREATE,		"CREATE" }, \
-	{ XFS_TRANS_CREATE_TMPFILE,	"CREATE_TMPFILE" }, \
 	{ XFS_TRANS_CREATE_TRUNC,	"CREATE_TRUNC" }, \
 	{ XFS_TRANS_TRUNCATE_FILE,	"TRUNCATE_FILE" }, \
 	{ XFS_TRANS_REMOVE,		"REMOVE" }, \
@@ -134,23 +131,23 @@ extern const struct xfs_buf_ops xfs_symlink_buf_ops;
 	{ XFS_TRANS_ATTR_RM,		"ATTR_RM" }, \
 	{ XFS_TRANS_ATTR_FLAG,		"ATTR_FLAG" }, \
 	{ XFS_TRANS_CLEAR_AGI_BUCKET,	"CLEAR_AGI_BUCKET" }, \
-	{ XFS_TRANS_QM_SBCHANGE,	"QM_SBCHANGE" }, \
+	{ XFS_TRANS_SB_CHANGE,		"SBCHANGE" }, \
+	{ XFS_TRANS_DUMMY1,		"DUMMY1" }, \
+	{ XFS_TRANS_DUMMY2,		"DUMMY2" }, \
 	{ XFS_TRANS_QM_QUOTAOFF,	"QM_QUOTAOFF" }, \
 	{ XFS_TRANS_QM_DQALLOC,		"QM_DQALLOC" }, \
 	{ XFS_TRANS_QM_SETQLIM,		"QM_SETQLIM" }, \
 	{ XFS_TRANS_QM_DQCLUSTER,	"QM_DQCLUSTER" }, \
 	{ XFS_TRANS_QM_QINOCREATE,	"QM_QINOCREATE" }, \
 	{ XFS_TRANS_QM_QUOTAOFF_END,	"QM_QOFF_END" }, \
-	{ XFS_TRANS_SB_UNIT,		"SB_UNIT" }, \
 	{ XFS_TRANS_FSYNC_TS,		"FSYNC_TS" }, \
 	{ XFS_TRANS_GROWFSRT_ALLOC,	"GROWFSRT_ALLOC" }, \
 	{ XFS_TRANS_GROWFSRT_ZERO,	"GROWFSRT_ZERO" }, \
 	{ XFS_TRANS_GROWFSRT_FREE,	"GROWFSRT_FREE" }, \
 	{ XFS_TRANS_SWAPEXT,		"SWAPEXT" }, \
-	{ XFS_TRANS_SB_COUNT,		"SB_COUNT" }, \
 	{ XFS_TRANS_CHECKPOINT,		"CHECKPOINT" }, \
-	{ XFS_TRANS_DUMMY1,		"DUMMY1" }, \
-	{ XFS_TRANS_DUMMY2,		"DUMMY2" }, \
+	{ XFS_TRANS_ICREATE,		"ICREATE" }, \
+	{ XFS_TRANS_CREATE_TMPFILE,	"CREATE_TMPFILE" }, \
 	{ XLOG_UNMOUNT_REC_TYPE,	"UNMOUNT" }
 
 /*
libxfs/xfs_trans_resv.c +0 -14
index d81ce08..0c40b52 100644
@@ -715,17 +715,6 @@ xfs_calc_clear_agi_bucket_reservation(
 }
 
 /*
- * Clearing the quotaflags in the superblock.
- *	the super block for changing quota flags: sector size
- */
-STATIC uint
-xfs_calc_qm_sbchange_reservation(
-	struct xfs_mount	*mp)
-{
-	return xfs_calc_buf_res(1, mp->m_sb.sb_sectsize);
-}
-
-/*
  * Adjusting quota limits.
  *    the xfs_disk_dquot_t: sizeof(struct xfs_disk_dquot)
  */
@@ -863,9 +852,6 @@ xfs_trans_resv_calc(
 	 * The following transactions are logged in logical format with
 	 * a default log count.
 	 */
-	resp->tr_qm_sbchange.tr_logres = xfs_calc_qm_sbchange_reservation(mp);
-	resp->tr_qm_sbchange.tr_logcount = XFS_DEFAULT_LOG_COUNT;
-
 	resp->tr_qm_setqlim.tr_logres = xfs_calc_qm_setqlim_reservation(mp);
 	resp->tr_qm_setqlim.tr_logcount = XFS_DEFAULT_LOG_COUNT;
 
libxfs/xfs_trans_resv.h +0 -1
index 1097d14..2d5bdfc 100644
@@ -56,7 +56,6 @@ struct xfs_trans_resv {
 	struct xfs_trans_res	tr_growrtalloc;	/* grow realtime allocations */
 	struct xfs_trans_res	tr_growrtzero;	/* grow realtime zeroing */
 	struct xfs_trans_res	tr_growrtfree;	/* grow realtime freeing */
-	struct xfs_trans_res	tr_qm_sbchange;	/* change quota flags */
 	struct xfs_trans_res	tr_qm_setqlim;	/* adjust quota limits */
 	struct xfs_trans_res	tr_qm_dqalloc;	/* allocate quota on disk */
 	struct xfs_trans_res	tr_qm_quotaoff;	/* turn quota off */
mkfs/proto.c +3 -3
index 18a2553..45565b7 100644
@@ -551,7 +551,7 @@ parseproto(
 		if (!pip) {
 			pip = ip;
 			mp->m_sb.sb_rootino = ip->i_ino;
-			libxfs_mod_sb(tp);
+			libxfs_log_sb(tp);
 			isroot = 1;
 		} else {
 			libxfs_trans_ijoin(tp, pip, 0);
@@ -657,7 +657,7 @@ rtinit(
 	rbmip->i_d.di_flags = XFS_DIFLAG_NEWRTBM;
 	*(__uint64_t *)&rbmip->i_d.di_atime = 0;
 	libxfs_trans_log_inode(tp, rbmip, XFS_ILOG_CORE);
-	libxfs_mod_sb(tp);
+	libxfs_log_sb(tp);
 	mp->m_rbmip = rbmip;
 	error = -libxfs_inode_alloc(&tp, NULL, S_IFREG, 1, 0,
 					&creds, &fsxattrs, &rsumip);
@@ -667,7 +667,7 @@ rtinit(
 	mp->m_sb.sb_rsumino = rsumip->i_ino;
 	rsumip->i_d.di_size = mp->m_rsumsize;
 	libxfs_trans_log_inode(tp, rsumip, XFS_ILOG_CORE);
-	libxfs_mod_sb(tp);
+	libxfs_log_sb(tp);
 	libxfs_trans_commit(tp, 0);
 	mp->m_rsumip = rsumip;
 	/*
Signature · 6 lines
1.9.3

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#5 lore raw
In reply to Brian Foster
Quoted 6 lines · Brian Foster

Hi all,

Patches 1 and 2 are a couple metadump fixes that fell out from playing around with large block size filesystems (e.g., 64k on ppc64), similar to the repair patches I had sent recently. Patches 3 and 4 are backports of a couple of the sb logging rework fixes.

I'll pull the fixes into the current branch - we've probably got enough fixes queued up now to justify a 3.2.3 release.

Quoted 7 lines

Dave,

I'm not sure what the workflow here is wrt to the sb logging backports. FWIW, these are the only patches I need on top of the libxfs-3.19-update branch to get most of the sparse inode bits to backport cleanly. Do you want to include them in that branch? Otherwise, I'll just keep them in my sparse inodes branch for now.

What needs to happen is a full sync up to 4.0-rc1 - the libxfs kernel side is a moving target. Hopefully that's not a huge amount of work right now - I'll see if I can get it done by the end of the week.

But, really, the biggest roadblock right now is getting some review of the major updates and build changes that are in that branch so we can move it towards a 3.3. release sooner rather than later.

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs