Skip to contentSkip to conversation

current patch queue for 3.12

PATCH In review Dave Chinner 9 participants 158 messages Jul 19, 2013 – Aug 20, 2013 XFS filesystem Page 2 of 2

lore
Share & tools
lore
#96 lore raw

Re: [PATCH 42/49] xfs: Validate log space at mount time

In reply to Dave Chinner
Quoted 40 lines · Dave Chinner

From: Jie Liu <[email protected]>

Validate log space during log mount stage, the underlying function will drop a warning message via syslog in critical level if the log space is too small or too large.

[ dchinner: For CRC enable filesystems, abort the mounting of the filesystem as mkfs should never make a log too small for the given filesystem configuration. ]

---
 fs/xfs/xfs_log.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 48 insertions(+), 1 deletion(-)
fs/xfs/xfs_log.c +8 -1
index b02415b..64b1f01 100644
@@ -614,7 +614,9 @@ xfs_log_mount(
 	xfs_daddr_t	blk_offset,
 	int		num_bblks)
 {
-	int		error;
+	int		error = 0;
+	int		min_logfsbs;
+	int		max_logfsbs;
 
 	if (!(mp->m_flags & XFS_MOUNT_NORECOVERY))
 		xfs_notice(mp, "Mounting Filesystem");
@@ -631,6 +633,51 @@ xfs_log_mount(
 	}
 
 	/*
+	 * Validate the given log space and drop a critical message via syslog
+	 * if the log size is too small that would lead to some unexpected
+	 * situations in transaction log space reservation stage.
+	 *
+	 * Note: we can't just reject the mount if the validation fails.  This

fs/xfs/xfs_log.c xfs_log_mount( · line 650

Quoted 10 lines
fs/xfs/xfs_log.c +10 -0
+	 * would mean that people would have to downgrade their kernel just to
+	 * remedy the situation as there is no way to grow the log (short of
+	 * black magic surgery with xfs_db).
+	 *
+	 * We can, however, reject mounts for CRC format filesystems, as the
+	 * mkfs binary being used to make the filesystem should never create a
+	 * filesystem with a log that is too small.
+	 */
+	min_logfsbs = xfs_log_calc_minimum_size(mp);
+	max_logfsbs = XFS_BB_TO_FSB(mp, XFS_MAX_LOG_BLOCKS);

Actually, that's busted:

XFS (vdc): Log size 521728 blocks too large, maximum size is 131072 blocks XFS (vdc): Log size out of supported range. Continuing onwards, but if log hangs are experienced then please report this message in the bug report.

I'll need to revisit this.

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

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

PATCH 43/49 xfs: return log item size in IOP_SIZE

In reply to Dave Chinner

From: Dave Chinner <[email protected]>

To begin optimising the CIL commit process, we need to have IOP_SIZE return both the number of vectors and the size of the data pointed to by the vectors. This enables us to calculate the size ofthe memory allocation needed before the formatting step and reduces the number of memory allocations per item by one.

WhIle there, kill the IOP_SIZE macro.

---
 fs/xfs/xfs_buf_item.c     | 52 ++++++++++++++++++++++++++++------------------
 fs/xfs/xfs_dquot_item.c   | 22 ++++++++++++--------
 fs/xfs/xfs_extfree_item.c | 50 ++++++++++++++++++++++++++++----------------
 fs/xfs/xfs_icreate_item.c |  9 +++++---
 fs/xfs/xfs_inode_item.c   | 53 +++++++++++++++++++++++++++++++----------------
 fs/xfs/xfs_log_cil.c      | 10 ++++++---
 fs/xfs/xfs_trans.h        |  3 +--
 7 files changed, 126 insertions(+), 73 deletions(-)
fs/xfs/xfs_buf_item.c +32 -20
index bfc4e0c..9358504 100644
@@ -39,6 +39,14 @@ static inline struct xfs_buf_log_item *BUF_ITEM(struct xfs_log_item *lip)
 
 STATIC void	xfs_buf_do_callbacks(struct xfs_buf *bp);
 
+static inline int
+xfs_buf_log_format_size(
+	struct xfs_buf_log_format *blfp)
+{
+	return offsetof(struct xfs_buf_log_format, blf_data_map) +
+			(blfp->blf_map_size * sizeof(blfp->blf_data_map[0]));
+}
+
 /*
  * This returns the number of log iovecs needed to log the
  * given buf log item.
@@ -49,25 +57,27 @@ STATIC void	xfs_buf_do_callbacks(struct xfs_buf *bp);
  *
  * If the XFS_BLI_STALE flag has been set, then log nothing.
  */
-STATIC uint
+STATIC void
 xfs_buf_item_size_segment(
 	struct xfs_buf_log_item	*bip,
-	struct xfs_buf_log_format *blfp)
+	struct xfs_buf_log_format *blfp,
+	int			*nvecs,
+	int			*nbytes)
 {
 	struct xfs_buf		*bp = bip->bli_buf;
-	uint			nvecs;
 	int			next_bit;
 	int			last_bit;
 
 	last_bit = xfs_next_bit(blfp->blf_data_map, blfp->blf_map_size, 0);
 	if (last_bit == -1)
-		return 0;
+		return;
 
 	/*
 	 * initial count for a dirty buffer is 2 vectors - the format structure
 	 * and the first dirty region.
 	 */
-	nvecs = 2;
+	*nvecs += 2;
+	*nbytes += xfs_buf_log_format_size(blfp) + XFS_BLF_CHUNK;
 
 	while (last_bit != -1) {
 		/*
@@ -87,18 +97,17 @@ xfs_buf_item_size_segment(
 			break;
 		} else if (next_bit != last_bit + 1) {
 			last_bit = next_bit;
-			nvecs++;
+			(*nvecs)++;
 		} else if (xfs_buf_offset(bp, next_bit * XFS_BLF_CHUNK) !=
 			   (xfs_buf_offset(bp, last_bit * XFS_BLF_CHUNK) +
 			    XFS_BLF_CHUNK)) {
 			last_bit = next_bit;
-			nvecs++;
+			(*nvecs)++;
 		} else {
 			last_bit++;
 		}
+		*nbytes += XFS_BLF_CHUNK;
 	}
-
-	return nvecs;
 }
 
 /*
@@ -118,12 +127,13 @@ xfs_buf_item_size_segment(
  * If the XFS_BLI_STALE flag has been set, then log nothing but the buf log
  * format structures.
  */
-STATIC uint
+STATIC void
 xfs_buf_item_size(
-	struct xfs_log_item	*lip)
+	struct xfs_log_item	*lip,
+	int			*nvecs,
+	int			*nbytes)
 {
 	struct xfs_buf_log_item	*bip = BUF_ITEM(lip);
-	uint			nvecs;
 	int			i;
 
 	ASSERT(atomic_read(&bip->bli_refcount) > 0);
@@ -135,7 +145,11 @@ xfs_buf_item_size(
 		 */
 		trace_xfs_buf_item_size_stale(bip);
 		ASSERT(bip->__bli_format.blf_flags & XFS_BLF_CANCEL);
-		return bip->bli_format_count;
+		*nvecs += bip->bli_format_count;
+		for (i = 0; i < bip->bli_format_count; i++) {
+			*nbytes += xfs_buf_log_format_size(&bip->bli_formats[i]);
+		}
+		return;
 	}
 
 	ASSERT(bip->bli_flags & XFS_BLI_LOGGED);
@@ -147,7 +161,8 @@ xfs_buf_item_size(
 		 * commit, so no vectors are used at all.
 		 */
 		trace_xfs_buf_item_size_ordered(bip);
-		return XFS_LOG_VEC_ORDERED;
+		*nvecs = XFS_LOG_VEC_ORDERED;
+		return;
 	}
 
 	/*
@@ -159,13 +174,11 @@ xfs_buf_item_size(
 	 * count for the extra buf log format structure that will need to be
 	 * written.
 	 */
-	nvecs = 0;
 	for (i = 0; i < bip->bli_format_count; i++) {
-		nvecs += xfs_buf_item_size_segment(bip, &bip->bli_formats[i]);
+		xfs_buf_item_size_segment(bip, &bip->bli_formats[i],
+					  nvecs, nbytes);
 	}
-
 	trace_xfs_buf_item_size(bip);
-	return nvecs;
 }
 
 static struct xfs_log_iovec *
@@ -192,8 +205,7 @@ xfs_buf_item_format_segment(
 	 * the actual size of the dirty bitmap rather than the size of the in
 	 * memory structure.
 	 */
-	base_size = offsetof(struct xfs_buf_log_format, blf_data_map) +
-			(blfp->blf_map_size * sizeof(blfp->blf_data_map[0]));
+	base_size = xfs_buf_log_format_size(blfp);
 
 	nvecs = 0;
 	first_bit = xfs_next_bit(blfp->blf_data_map, blfp->blf_map_size, 0);
fs/xfs/xfs_dquot_item.c +13 -9
index f07a436..60c6e1f 100644
@@ -44,14 +44,15 @@ static inline struct xfs_dq_logitem *DQUOT_ITEM(struct xfs_log_item *lip)
 /*
  * returns the number of iovecs needed to log the given dquot item.
  */
-STATIC uint
+STATIC void
 xfs_qm_dquot_logitem_size(
-	struct xfs_log_item	*lip)
+	struct xfs_log_item	*lip,
+	int			*nvecs,
+	int			*nbytes)
 {
-	/*
-	 * we need only two iovecs, one for the format, one for the real thing
-	 */
-	return 2;
+	*nvecs += 2;
+	*nbytes += sizeof(struct xfs_dq_logformat) +
+		   sizeof(struct xfs_disk_dquot);
 }
 
 /*
@@ -286,11 +287,14 @@ static inline struct xfs_qoff_logitem *QOFF_ITEM(struct xfs_log_item *lip)
  * We only need 1 iovec for an quotaoff item.  It just logs the
  * quotaoff_log_format structure.
  */
-STATIC uint
+STATIC void
 xfs_qm_qoff_logitem_size(
-	struct xfs_log_item	*lip)
+	struct xfs_log_item	*lip,
+	int			*nvecs,
+	int			*nbytes)
 {
-	return 1;
+	*nvecs += 1;
+	*nbytes += sizeof(struct xfs_qoff_logitem);
 }
 
 /*
fs/xfs/xfs_extfree_item.c +32 -18

95 lines not on this page · raw message

fs/xfs/xfs_icreate_item.c +6 -3
index 441a78a..5a5a593 100644
@@ -40,11 +40,14 @@ static inline struct xfs_icreate_item *ICR_ITEM(struct xfs_log_item *lip)
  *
  * We only need one iovec for the icreate log structure.
  */
-STATIC uint
+STATIC void
 xfs_icreate_item_size(
-	struct xfs_log_item	*lip)
+	struct xfs_log_item	*lip,
+	int			*nvecs,
+	int			*nbytes)
 {
-	return 1;
+	*nvecs += 1;
+	*nbytes += sizeof(struct xfs_icreate_log);
 }
 
 /*
fs/xfs/xfs_inode_item.c +35 -18

102 lines not on this page · raw message

fs/xfs/xfs_log_cil.c +7 -3
index 02b9cf3..4e10872 100644
@@ -122,19 +122,23 @@ xlog_cil_prepare_log_vecs(
 	}
 
 	list_for_each_entry(lidp, &tp->t_items, lid_trans) {
+		struct xfs_log_item *lip = lidp->lid_item;
 		struct xfs_log_vec *new_lv;
 		void	*ptr;
 		int	index;
 		int	len = 0;
-		uint	niovecs;
+		uint	niovecs = 0;
+		uint	nbytes = 0;
 		bool	ordered = false;
 
 		/* Skip items which aren't dirty in this transaction. */
 		if (!(lidp->lid_flags & XFS_LID_DIRTY))
 			continue;
 
+		/* get number of vecs and size of data to be stored */
+		lip->li_ops->iop_size(lip, &niovecs, &nbytes);
+
 		/* Skip items that do not have any vectors for writing */
-		niovecs = IOP_SIZE(lidp->lid_item);
 		if (!niovecs)
 			continue;
 
@@ -152,7 +156,7 @@ xlog_cil_prepare_log_vecs(
 				niovecs * sizeof(struct xfs_log_iovec),
 				KM_SLEEP|KM_NOFS);
 
-		new_lv->lv_item = lidp->lid_item;
+		new_lv->lv_item = lip;
 		new_lv->lv_niovecs = niovecs;
 		if (ordered) {
 			/* track as an ordered logvec */
fs/xfs/xfs_trans.h +1 -2
index 7eb81cc..97144ec 100644
@@ -67,7 +67,7 @@ typedef struct xfs_log_item {
 	{ XFS_LI_ABORTED,	"ABORTED" }
 
 struct xfs_item_ops {
-	uint (*iop_size)(xfs_log_item_t *);
+	void (*iop_size)(xfs_log_item_t *, int *, int *);
 	void (*iop_format)(xfs_log_item_t *, struct xfs_log_iovec *);
 	void (*iop_pin)(xfs_log_item_t *);
 	void (*iop_unpin)(xfs_log_item_t *, int remove);
@@ -77,7 +77,6 @@ struct xfs_item_ops {
 	void (*iop_committing)(xfs_log_item_t *, xfs_lsn_t);
 };
 
-#define IOP_SIZE(ip)		(*(ip)->li_ops->iop_size)(ip)
 #define IOP_FORMAT(ip,vp)	(*(ip)->li_ops->iop_format)(ip, vp)
 #define IOP_PIN(ip)		(*(ip)->li_ops->iop_pin)(ip)
 #define IOP_UNPIN(ip, remove)	(*(ip)->li_ops->iop_unpin)(ip, remove)
Signature · 6 lines
1.8.3.2

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by on v1 43/49
#98 lore raw

Re: [PATCH 43/49] xfs: return log item size in IOP_SIZE

Quoted 11 lines · Dave Chinner

From: Dave Chinner<[email protected]>

To begin optimising the CIL commit process, we need to have IOP_SIZE return both the number of vectors and the size of the data pointed to by the vectors. This enables us to calculate the size ofthe memory allocation needed before the formatting step and reduces the number of memory allocations per item by one.

WhIle there, kill the IOP_SIZE macro.

Looks good.

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

#99 lore raw

Re: [PATCH 43/49] xfs: return log item size in IOP_SIZE

In reply to Dave Chinner
Quoted 9 lines · Dave Chinner

From: Dave Chinner <[email protected]>

To begin optimising the CIL commit process, we need to have IOP_SIZE return both the number of vectors and the size of the data pointed to by the vectors. This enables us to calculate the size ofthe memory allocation needed before the formatting step and reduces the number of memory allocations per item by one.

WhIle there, kill the IOP_SIZE macro.

Instead of killing a single of those here add a patch earlier in the series that kills all IO_* macros.

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

#100 lore raw

PATCH 44/49 xfs: Reduce allocations during CIL insertion

In reply to Dave Chinner

From: Dave Chinner <[email protected]>

Now that we have the size of the object before the formatting pass is called, we can allocation the log vector and it's buffer in a single allocation rather than two separate allocations.

Store the size of the allocated buffer in the log vector so that we potentially avoid allocation for future modifications of the object.

While touching this code, remove the IOP_FORMAT definition.

---
 fs/xfs/xfs_log.h     |  1 +
 fs/xfs/xfs_log_cil.c | 94 ++++++++++++++++++++++++++++++----------------------
 fs/xfs/xfs_trans.h   |  1 -
 3 files changed, 56 insertions(+), 40 deletions(-)
fs/xfs/xfs_log.h +1 -0
index e63d9e1..1c45848 100644
@@ -27,6 +27,7 @@ struct xfs_log_vec {
 	struct xfs_log_item	*lv_item;	/* owner */
 	char			*lv_buf;	/* formatted buffer */
 	int			lv_buf_len;	/* size of formatted buffer */
+	int			lv_size;	/* size of allocated lv */
 };
 
 #define XFS_LOG_VEC_ORDERED	(-1)
fs/xfs/xfs_log_cil.c +55 -39

142 lines not on this page · raw message

fs/xfs/xfs_trans.h +0 -1
index 97144ec..24bbdcd 100644
@@ -77,7 +77,6 @@ struct xfs_item_ops {
 	void (*iop_committing)(xfs_log_item_t *, xfs_lsn_t);
 };
 
-#define IOP_FORMAT(ip,vp)	(*(ip)->li_ops->iop_format)(ip, vp)
 #define IOP_PIN(ip)		(*(ip)->li_ops->iop_pin)(ip)
 #define IOP_UNPIN(ip, remove)	(*(ip)->li_ops->iop_unpin)(ip, remove)
 #define IOP_PUSH(ip, list)	(*(ip)->li_ops->iop_push)(ip, list)
Signature · 6 lines
1.8.3.2

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by on v1 44/49
#101 lore raw

Re: [PATCH 44/49] xfs: Reduce allocations during CIL insertion

Quoted 6 lines · Dave Chinner

From: Dave Chinner<[email protected]>

Now that we have the size of the object before the formatting pass is called, we can allocation the log vector and it's buffer in a single allocation rather than two separate allocations.

Quoted 7 lines

Store the size of the allocated buffer in the log vector so that we potentially avoid allocation for future modifications of the object.

While touching this code, remove the IOP_FORMAT definition.

Looks good.

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

#102 lore raw

Re: [PATCH 44/49] xfs: Reduce allocations during CIL insertion

Quoted 15 lines · Mark Tinguely
Quoted 6 lines · Dave Chinner

From: Dave Chinner<[email protected]>

Now that we have the size of the object before the formatting pass is called, we can allocation the log vector and it's buffer in a single allocation rather than two separate allocations.

Quoted 7 lines

Store the size of the allocated buffer in the log vector so that we potentially avoid allocation for future modifications of the object.

While touching this code, remove the IOP_FORMAT definition.

Quoted 8 lines

Looks good.

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

I'd like to register a gentle "test this well" protest on this patch. While trying to figure out the origin of an unrelated lockdep, I tried to copy 3 kernel gits from one 2k non-CRC XFS filesystem to another one. With at least this patch used, the cp operation stops, leading to not-umountable, not-syncable filesystems. It might be while copying the 2nd git, or the 3rd git, while copying header files, or while copying those large *.pack files, but it will happen somewhere.

A bisect of the issue ends on this patch, but its removal means that 45_49 and 46_49 cannot be applied without good knowledge of the code to be patched.

This one's on me for not being able to get good information to Dave. If I can find a way to get trace-cmd to pipe over ssh or something like that, then maybe there's a chance to make a file that trace-cmd report can read. Previous attempts to save to different filesystems or save over NFS and CIFS have all failed. Will keep trying...

For diagnosing this patch, is there an effective trace that is rather small? And would you need more than just the XFS events?

Thanks!

Michael

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

#103 lore raw

Re: [PATCH 44/49] xfs: Reduce allocations during CIL insertion

Quoted 44 lines · Michael L. Semon
Quoted 15 lines · Mark Tinguely
Quoted 6 lines · Dave Chinner

From: Dave Chinner<[email protected]>

Now that we have the size of the object before the formatting pass is called, we can allocation the log vector and it's buffer in a single allocation rather than two separate allocations.

Quoted 7 lines

Store the size of the allocated buffer in the log vector so that we potentially avoid allocation for future modifications of the object.

While touching this code, remove the IOP_FORMAT definition.

Quoted 8 lines

Looks good.

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

I'd like to register a gentle "test this well" protest on this patch. While trying to figure out the origin of an unrelated lockdep, I tried to copy 3 kernel gits from one 2k non-CRC XFS filesystem to another one. With at least this patch used, the cp operatin stops, leading to not-umountable, not-syncable filesystems. It might be while copying the 2nd git, or the 3rd git, while copying header files, or while copying those large *.pack files, but it will happen somewhere.

A bisect of the issue ends on this patch, but its removal means that 45_49 and 46_49 cannot be applied without good knowledge of the code to be patched.

This one's on me for not being able to get good information to Dave. If I can find a way to get trace-cmd to pipe over ssh or something like that, then maybe there's a chance to make a file that trace-cmd report can read. Previous attempts to save to different filesystems or save over NFS and CIFS have all failed. Will keep trying...

Quoted 7 lines

For diagnosing this patch, is there an effective trace that is rather small? And would you need more than just the XFS events?

Thanks!

Michael

Thanks for the heads up.

If you could please redo the test and get the stack traces with /proc/sysrq-trigger and if you kernel works with crash, a core dump. For the stack trace, I mostly want to know if it has several "xlog_grant_head_wait" entries in it, because ...

...I seemed to have triggered a couple log space reservation hangs with fsstress one XFS partition and a mega-copy on another partition, but will have to graft the new XFS tree onto a Linux 3.10 kernel to get crash (and one of my sata controllers) to work again.

Thanks.

--Mark.

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

#104 lore raw

Re: [PATCH 44/49] xfs: Reduce allocations during CIL insertion

Quoted 59 lines · Mark Tinguely
Quoted 50 lines · Michael L. Semon
Quoted 19 lines · Mark Tinguely
Quoted 7 lines · Dave Chinner

From: Dave Chinner<[email protected]>

Now that we have the size of the object before the formatting pass is called, we can allocation the log vector and it's buffer in a single allocation rather than two separate allocations.

Quoted 8 lines

Store the size of the allocated buffer in the log vector so that we potentially avoid allocation for future modifications of the object.

While touching this code, remove the IOP_FORMAT definition.

Quoted 8 lines

Looks good.

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

I'd like to register a gentle "test this well" protest on this patch. While trying to figure out the origin of an unrelated lockdep, I tried to copy 3 kernel gits from one 2k non-CRC XFS filesystem to another one. With at least this patch used, the cp operatin stops, leading to not-umountable, not-syncable filesystems. It might be while copying the 2nd git, or the 3rd git, while copying header files, or while copying those large *.pack files, but it will happen somewhere.

A bisect of the issue ends on this patch, but its removal means that 45_49 and 46_49 cannot be applied without good knowledge of the code to be patched.

This one's on me for not being able to get good information to Dave. If I can find a way to get trace-cmd to pipe over ssh or something like that, then maybe there's a chance to make a file that trace-cmd report can read. Previous attempts to save to different filesystems or save over NFS and CIFS have all failed. Will keep trying...

Quoted 7 lines

For diagnosing this patch, is there an effective trace that is rather small? And would you need more than just the XFS events?

Thanks!

Michael

Quoted 6 lines

Thanks for the heads up.

If you could please redo the test and get the stack traces with /proc/sysrq-trigger and if you kernel works with crash, a core dump. For the stack trace, I mostly want to know if it has several "xlog_grant_head_wait" entries in it, because ...

There are those entries. I have a trace from the hung-task detector, from the previous round of testing. So if the hard drive light goes out, wait a couple of minutes for the hung-task detector to kick in.

[ 2640.393845] INFO: task kworker/u2:3:50 blocked for more than 120 seconds.
[ 2640.393939] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs"
disables this message.
[ 2640.394024] kworker/u2:3    D e95d7100     0    50      2 0x00000000
[ 2640.394237] Workqueue: writeback bdi_writeback_workfn (flush-8:16)
[ 2640.394411]  ee987b18 00000092 e95d712c e95d7100 00000001 ee8b5550
0c7183c1 0000021a
[ 2640.394925]  ee986000 ee8b5550 ee986000 c117c369 e9e9ec40 00000001
c11b7f8a c11a990c
[ 2640.395422]  d1693460 00000000 00000246 00000000 ee987b28 00000005
ea335800 00000001
[ 2640.395936] Call Trace:
[ 2640.396029]  [<c117c369>] ? xfs_trans_free+0x5d/0x61
[ 2640.396105]  [<c11b7f8a>] ? xlog_space_left+0x26/0x9f
[ 2640.396203]  [<c11a990c>] ? xfs_iunlock+0x6d/0xc4
[ 2640.396279]  [<c11b8ddc>] ? xlog_grant_head_wait+0x55/0x14d
[ 2640.396378]  [<c13a67b6>] schedule+0x22/0x4e
[ 2640.396451]  [<c11b8df5>] xlog_grant_head_wait+0x6e/0x14d
[ 2640.396550]  [<c11b900b>] xlog_grant_head_check+0x72/0xc1
[ 2640.396626]  [<c11bb44c>] xfs_log_reserve+0xaf/0x22d
[ 2640.396724]  [<c117c813>] ? xfs_trans_alloc+0x1f/0x35
[ 2640.396799]  [<c117cacb>] xfs_trans_reserve+0x1f2/0x1f9
[ 2640.396900]  [<c116081e>] xfs_setfilesize_trans_alloc.isra.5+0x3d/0xa1
[ 2640.396981]  [<c1161d84>] xfs_vm_writepage+0x1ef/0x575
[ 2640.397084]  [<c109efac>] __writepage+0x13/0x39
[ 2640.397159]  [<c109ef99>] ? global_dirtyable_memory+0x39/0x39
[ 2640.397260]  [<c10a086b>] write_cache_pages+0x1c4/0x3f8
[ 2640.397336]  [<c109ef99>] ? global_dirtyable_memory+0x39/0x39
[ 2640.397436]  [<c1064e3f>] ? trace_hardirqs_on_caller+0x14/0x1b1
[ 2640.397514]  [<c11609c2>] ? xfs_vm_writepages+0x22/0x42
[ 2640.397611]  [<c10a0ad6>] generic_writepages+0x37/0x51
[ 2640.397685]  [<c11609da>] xfs_vm_writepages+0x3a/0x42
[ 2640.397782]  [<c10a0b0d>] do_writepages+0x1d/0x2a
[ 2640.397854]  [<c10e7d97>] __writeback_single_inode+0x42/0x229
[ 2640.397952]  [<c10e82de>] writeback_sb_inodes+0x232/0x385
[ 2640.398027]  [<c10e84a4>] __writeback_inodes_wb+0x73/0xa2
[ 2640.398124]  [<c10e8699>] wb_writeback+0x1c6/0x27a
[ 2640.398196]  [<c10e997e>] bdi_writeback_workfn+0x217/0x36d
[ 2640.398294]  [<c104241b>] process_one_work+0x18f/0x454
[ 2640.398367]  [<c10423de>] ? process_one_work+0x152/0x454
[ 2640.398464]  [<c10427d6>] worker_thread+0xf6/0x319
[ 2640.398537]  [<c10426e0>] ? process_one_work+0x454/0x454
[ 2640.398634]  [<c1047c5b>] kthread+0x9e/0xa0
[ 2640.398708]  [<c13a91b7>] ret_from_kernel_thread+0x1b/0x28
[ 2640.398806]  [<c1047bbd>] ? __kthread_parkme+0x5b/0x5b

In previous testing, not much of the SysRq keys worked, and forced crash didn't seem to have anything XFS in it, like it was reporting the steps needed to crash. I'll keep trying and alter my Alt-Shift-SysRq-e-i-e-i-s-u-s-e-i-e-i-o termination string a bit, maybe set the "Panic on Hung Tasks" settings in the kernel as well.

Quoted 8 lines

...I seemed to have triggered a couple log space reservation hangs with fsstress one XFS partition and a mega-copy on another partition, but will have to graft the new XFS tree onto a Linux 3.10 kernel to get crash (and one of my sata controllers) to work again.

Thanks.

--Mark.

Does this have anything to do with the XFS_RSVSP64 kind of strings output in some test failures, or does that have more to do with speculative preallocation?

Thanks!

Michael

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

#105 lore raw

Re: [PATCH 44/49] xfs: Reduce allocations during CIL insertion

In reply to Mark Tinguely
Quoted 9 lines · Mark Tinguely

If you could please redo the test and get the stack traces with /proc/sysrq-trigger and if you kernel works with crash, a core dump. For the stack trace, I mostly want to know if it has several "xlog_grant_head_wait" entries in it, because ...

...I seemed to have triggered a couple log space reservation hangs with fsstress one XFS partition and a mega-copy on another partition, but will have to graft the new XFS tree onto a Linux 3.10 kernel to get crash (and one of my sata controllers) to work again.

They are unrelated to this patchset.

Somewhere in the code there
is a mismatch between what we reserve as the base requirement for an actual log write and what the CIL actually steals, and that is, most likely, what is leading to log hangs.

This is demonstratable in the fact that generic/070 on 512 byte block size filesystems regularly hits a transaction reservation exhausted assert failure on transaction commit of the periodic log dummy transaction on my test rigs.

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

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

Re: [PATCH 44/49] xfs: Reduce allocations during CIL insertion

Quoted 18 lines · Dave Chinner
Quoted 9 lines · Mark Tinguely

If you could please redo the test and get the stack traces with /proc/sysrq-trigger and if you kernel works with crash, a core dump. For the stack trace, I mostly want to know if it has several "xlog_grant_head_wait" entries in it, because ...

...I seemed to have triggered a couple log space reservation hangs with fsstress one XFS partition and a mega-copy on another partition, but will have to graft the new XFS tree onto a Linux 3.10 kernel to get crash (and one of my sata controllers) to work again.

They are unrelated to this patchset.

Somewhere in the code there
is a mismatch between what we reserve as the base requirement for an actual log write and what the CIL actually steals, and that is, most likely, what is leading to log hangs.

Quoted 8 lines

This is demonstratable in the fact that generic/070 on 512 byte block size filesystems regularly hits a transaction reservation exhausted assert failure on transaction commit of the periodic log dummy transaction on my test rigs.

Cheers,

Dave.

In testing patch 44, I did not trip over any cil stealing asserts before the hang. I think the cil steal assert is a different and a legitimate complaint. When I tripped over the ASSERT in with the v3 inode enabled, the writeid only reserves space for the sb but there were occasions of root btree and attribute fork entry that were also logged.

patch 43 runs for hours without incident. Previous to this series, I ran the same tests with parent pointer testing with much higher log reservations for day or two and never got a hang.

I tested patch 44 with copy like tests and both times it hung both times - not a convincing number of tests. A quick look, I see an empty AIL, empty CIL, the CTX is using 0 bytes, doesn't look like there are any cil pushes going nor any older ctx, the ctx has an empty ticket reservation. The log tail is 0xd000014d7 and reserve/grant is 0xe00204d04. The next reservation is for a rename transaction that uses just over the log space left. There has to be a log space leak. I will go back patch 43 on one machine and patch 44 on another and make sure it is patch 44 is causing the problem.

--Mark.

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

#107 lore raw

Re: [PATCH 44/49] xfs: Reduce allocations during CIL insertion

Quoted 39 lines · Mark Tinguely
Quoted 18 lines · Dave Chinner
Quoted 9 lines · Mark Tinguely

If you could please redo the test and get the stack traces with /proc/sysrq-trigger and if you kernel works with crash, a core dump. For the stack trace, I mostly want to know if it has several "xlog_grant_head_wait" entries in it, because ...

...I seemed to have triggered a couple log space reservation hangs with fsstress one XFS partition and a mega-copy on another partition, but will have to graft the new XFS tree onto a Linux 3.10 kernel to get crash (and one of my sata controllers) to work again.

They are unrelated to this patchset.

Somewhere in the code there
is a mismatch between what we reserve as the base requirement for an actual log write and what the CIL actually steals, and that is, most likely, what is leading to log hangs.

Quoted 8 lines

This is demonstratable in the fact that generic/070 on 512 byte block size filesystems regularly hits a transaction reservation exhausted assert failure on transaction commit of the periodic log dummy transaction on my test rigs.

Cheers,

Dave.

In testing patch 44, I did not trip over any cil stealing asserts before the hang. I think the cil steal assert is a different and a legitimate complaint. When I tripped over the ASSERT in with the v3 inode enabled, the writeid only reserves space for the sb but there were occasions of root btree and attribute fork entry that were also logged.

patch 43 runs for hours without incident. Previous to this series, I ran the same tests with parent pointer testing with much higher log reservations for day or two and never got a hang.

Quoted 9 lines

I tested patch 44 with copy like tests and both times it hung both times - not a convincing number of tests. A quick look, I see an empty AIL, empty CIL, the CTX is using 0 bytes, doesn't look like there are any cil pushes going nor any older ctx, the ctx has an empty ticket reservation. The log tail is 0xd000014d7 and reserve/grant is 0xe00204d04. The next reservation is for a rename transaction that uses just over the log space left. There has to be a log space leak. I will go back patch 43 on one machine and patch 44 on another and make sure it is patch 44 is causing the problem.

Right, a patch that makes transaction commits go faster is likely to cause a pre-existing reservation leak to leak faster....

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

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

Re: [PATCH 44/49] xfs: Reduce allocations during CIL insertion

In reply to Mark Tinguely
Quoted 55 lines · Mark Tinguely
Quoted 44 lines · Michael L. Semon
Quoted 15 lines · Mark Tinguely
Quoted 6 lines · Dave Chinner

From: Dave Chinner<[email protected]>

Now that we have the size of the object before the formatting pass is called, we can allocation the log vector and it's buffer in a single allocation rather than two separate allocations.

Quoted 7 lines

Store the size of the allocated buffer in the log vector so that we potentially avoid allocation for future modifications of the object.

While touching this code, remove the IOP_FORMAT definition.

Quoted 8 lines

Looks good.

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

I'd like to register a gentle "test this well" protest on this patch. While trying to figure out the origin of an unrelated lockdep, I tried to copy 3 kernel gits from one 2k non-CRC XFS filesystem to another one. With at least this patch used, the cp operatin stops, leading to not-umountable, not-syncable filesystems. It might be while copying the 2nd git, or the 3rd git, while copying header files, or while copying those large *.pack files, but it will happen somewhere.

A bisect of the issue ends on this patch, but its removal means that 45_49 and 46_49 cannot be applied without good knowledge of the code to be patched.

This one's on me for not being able to get good information to Dave. If I can find a way to get trace-cmd to pipe over ssh or something like that, then maybe there's a chance to make a file that trace-cmd report can read. Previous attempts to save to different filesystems or save over NFS and CIFS have all failed. Will keep trying...

Quoted 7 lines

For diagnosing this patch, is there an effective trace that is rather small? And would you need more than just the XFS events?

Thanks!

Michael

Thanks for the heads up.

Quoted 7 lines

If you could please redo the test and get the stack traces with /proc/sysrq-trigger and if you kernel works with crash, a core dump. For the stack trace, I mostly want to know if it has several "xlog_grant_head_wait" entries in it, because ...

...I seemed to have triggered a couple log space reservation hangs with fsstress one XFS partition and a mega-copy on another partition, but will have to graft the new XFS tree onto a Linux 3.10 kernel to get crash (and one of my sata controllers) to work again.

Thanks.

--Mark.

Well, I tried. Here's a Google Drive link, and hopefully it works:

https://drive.google.com/folderview?id=0B41268QKoNjtckwzVTJqWnIydEE

The instructions in Documentation/kdump/kdump.txt were followed fairly well. The dump was taken from /proc/vmcore and extracted like this:

$ cat /proc/vmcore | gzip -9vc > 4git-cp-kernel-dump-1.gz

You seem to have things well under control, so it all might not be needed, anyway. It does mean that kernel core dumps will go more quickly next time.

BTW, there's a "crash" program referenced in kdump.txt, and it's been downloaded but not built yet. Were you looking for output from the crash program?

Thanks!

Michael

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

#109 lore raw

Re: [PATCH 44/49] xfs: Reduce allocations during CIL insertion

Quoted 78 lines · Michael L. Semon
Quoted 55 lines · Mark Tinguely
Quoted 44 lines · Michael L. Semon
Quoted 15 lines · Mark Tinguely
Quoted 6 lines · Dave Chinner

From: Dave Chinner<[email protected]>

Now that we have the size of the object before the formatting pass is called, we can allocation the log vector and it's buffer in a single allocation rather than two separate allocations.

Quoted 7 lines

Store the size of the allocated buffer in the log vector so that we potentially avoid allocation for future modifications of the object.

While touching this code, remove the IOP_FORMAT definition.

Quoted 8 lines

Looks good.

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

I'd like to register a gentle "test this well" protest on this patch. While trying to figure out the origin of an unrelated lockdep, I tried to copy 3 kernel gits from one 2k non-CRC XFS filesystem to another one. With at least this patch used, the cp operatin stops, leading to not-umountable, not-syncable filesystems. It might be while copying the 2nd git, or the 3rd git, while copying header files, or while copying those large *.pack files, but it will happen somewhere.

A bisect of the issue ends on this patch, but its removal means that 45_49 and 46_49 cannot be applied without good knowledge of the code to be patched.

This one's on me for not being able to get good information to Dave. If I can find a way to get trace-cmd to pipe over ssh or something like that, then maybe there's a chance to make a file that trace-cmd report can read. Previous attempts to save to different filesystems or save over NFS and CIFS have all failed. Will keep trying...

Quoted 7 lines

For diagnosing this patch, is there an effective trace that is rather small? And would you need more than just the XFS events?

Thanks!

Michael

Thanks for the heads up.

Quoted 7 lines

If you could please redo the test and get the stack traces with /proc/sysrq-trigger and if you kernel works with crash, a core dump. For the stack trace, I mostly want to know if it has several "xlog_grant_head_wait" entries in it, because ...

...I seemed to have triggered a couple log space reservation hangs with fsstress one XFS partition and a mega-copy on another partition, but will have to graft the new XFS tree onto a Linux 3.10 kernel to get crash (and one of my sata controllers) to work again.

Thanks.

--Mark.

Well, I tried. Here's a Google Drive link, and hopefully it works:

https://drive.google.com/folderview?id=0B41268QKoNjtckwzVTJqWnIydEE

The instructions in Documentation/kdump/kdump.txt were followed fairly well. The dump was taken from /proc/vmcore and extracted like this:

$ cat /proc/vmcore | gzip -9vc>  4git-cp-kernel-dump-1.gz

You seem to have things well under control, so it all might not be needed, anyway. It does mean that kernel core dumps will go more quickly next time.

Quoted 7 lines

BTW, there's a "crash" program referenced in kdump.txt, and it's been downloaded but not built yet. Were you looking for output from the crash program?

Thanks!

Michael

Thanks more data. I will take a look. I will need the vmlinux, System.map, and xfs.ko (if xfs is a module).

I can reproduce a problem in patch 44 too. It takes my copy test 20 minutes to deplete the log space with patch 44, Same test with patch 43 has been running a day and a half. I do not think that patch 44 is 100 times faster than patch 43 but I will let patch 43 spin all weekend on a couple machines to verify that patch 43 does not hang.

Whatever the cause, it has to be fixed before bringing in patches 43-47.

--Mark.

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

#110 lore raw

Re: [PATCH 44/49] xfs: Reduce allocations during CIL insertion

Quoted 87 lines · Mark Tinguely
Quoted 78 lines · Michael L. Semon
Quoted 55 lines · Mark Tinguely
Quoted 44 lines · Michael L. Semon
Quoted 15 lines · Mark Tinguely
Quoted 6 lines · Dave Chinner

From: Dave Chinner<[email protected]>

Now that we have the size of the object before the formatting pass is called, we can allocation the log vector and it's buffer in a single allocation rather than two separate allocations.

Quoted 7 lines

Store the size of the allocated buffer in the log vector so that we potentially avoid allocation for future modifications of the object.

While touching this code, remove the IOP_FORMAT definition.

Quoted 8 lines

Looks good.

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

I'd like to register a gentle "test this well" protest on this patch. While trying to figure out the origin of an unrelated lockdep, I tried to copy 3 kernel gits from one 2k non-CRC XFS filesystem to another one. With at least this patch used, the cp operatin stops, leading to not-umountable, not-syncable filesystems. It might be while copying the 2nd git, or the 3rd git, while copying header files, or while copying those large *.pack files, but it will happen somewhere.

A bisect of the issue ends on this patch, but its removal means that 45_49 and 46_49 cannot be applied without good knowledge of the code to be patched.

This one's on me for not being able to get good information to Dave. If I can find a way to get trace-cmd to pipe over ssh or something like that, then maybe there's a chance to make a file that trace-cmd report can read. Previous attempts to save to different filesystems or save over NFS and CIFS have all failed. Will keep trying...

Quoted 7 lines

For diagnosing this patch, is there an effective trace that is rather small? And would you need more than just the XFS events?

Thanks!

Michael

Thanks for the heads up.

Quoted 7 lines

If you could please redo the test and get the stack traces with /proc/sysrq-trigger and if you kernel works with crash, a core dump. For the stack trace, I mostly want to know if it has several "xlog_grant_head_wait" entries in it, because ...

...I seemed to have triggered a couple log space reservation hangs with fsstress one XFS partition and a mega-copy on another partition, but will have to graft the new XFS tree onto a Linux 3.10 kernel to get crash (and one of my sata controllers) to work again.

Thanks.

--Mark.

Well, I tried. Here's a Google Drive link, and hopefully it works:

https://drive.google.com/folderview?id=0B41268QKoNjtckwzVTJqWnIydEE

The instructions in Documentation/kdump/kdump.txt were followed fairly well. The dump was taken from /proc/vmcore and extracted like this:

$ cat /proc/vmcore | gzip -9vc>  4git-cp-kernel-dump-1.gz

You seem to have things well under control, so it all might not be needed, anyway. It does mean that kernel core dumps will go more quickly next time.

Quoted 7 lines

BTW, there's a "crash" program referenced in kdump.txt, and it's been downloaded but not built yet. Were you looking for output from the crash program?

Thanks!

Michael

Quoted 7 lines

Thanks more data. I will take a look. I will need the vmlinux, System.map, and xfs.ko (if xfs is a module).

I can reproduce a problem in patch 44 too. It takes my copy test 20 minutes to deplete the log space with patch 44, Same test with patch 43 has been running a day and a half. I do not think that patch 44 is 100 times faster than patch 43 but I will let patch 43 spin all weekend on a couple machines to verify that patch 43 does not hang.

Whatever the cause, it has to be fixed before bringing in patches 43-47.

--Mark.

OK, I uploaded vmlinuz and System.map for both the system and capture kernels, plus the configs for both kernels. They're at the same link as the kernel core dump:

https://drive.google.com/folderview?id=0B41268QKoNjtckwzVTJqWnIydEE

These are taken from a 32-bit i686 Pentium 4 PC; I hope you won't have to drag a boat anchor out of storage in order to use them.

Thanks again!

Michael

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

#111 lore raw

Re: [PATCH 44/49] xfs: Reduce allocations during CIL insertion

In reply to Mark Tinguely
Quoted 6 lines · Mark Tinguely

I can reproduce a problem in patch 44 too. It takes my copy test 20 minutes to deplete the log space with patch 44, Same test with patch 43 has been running a day and a half. I do not think that patch 44 is 100 times faster than patch 43 but I will let patch 43 spin all weekend on a couple machines to verify that patch 43 does not hang.

Details, please. What's your "copy test"?

http://xfs.org/index.php/XFS_FAQ#Q:_What_information_should_I_include_when_reporting_a_problem.3F

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

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

Re: [PATCH 44/49] xfs: Reduce allocations during CIL insertion

Quoted 8 lines · Dave Chinner
Quoted 6 lines · Mark Tinguely

I can reproduce a problem in patch 44 too. It takes my copy test 20 minutes to deplete the log space with patch 44, Same test with patch 43 has been running a day and a half. I do not think that patch 44 is 100 times faster than patch 43 but I will let patch 43 spin all weekend on a couple machines to verify that patch 43 does not hang.

Quoted 7 lines

Details, please. What's your "copy test"?

http://xfs.org/index.php/XFS_FAQ#Q:_What_information_should_I_include_when_reporting_a_problem.3F

Cheers,

Dave.

Micheal found the problem using a simple copy, so I am using copy-like test.

I have hung patch 44 with fsstress but I am currently using the simple perl scripts from bugzilla bug 922, but I do not do the silly step of reducing the log to an abnormal amount.

Just mkfs the filesystem

Create the the test files. the creation script:
http://oss.sgi.com/bugzilla/attachment.cgi?id=304

Run the test script:
http://oss.sgi.com/bugzilla/attachment.cgi?id=305

          ----

This test seems to stress the log much like xfstest 273 only it runs forever.

I have a 32 bit machine:

meta-data=/dev/sda4              isize=256    agcount=4, agsize=601152 blks
         =                       sectsz=512   attr=2
data     =                       bsize=4096   blocks=2404608, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal               bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

and 64 bit machines with a little larger filesystems:

meta-data=/dev/sdb2              isize=256    agcount=4, agsize=2622080
meta-data=/dev/sda2              isize=256    agcount=4, agsize=4194432 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0
data     =                       bsize=4096   blocks=16777728, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal               bsize=4096   blocks=8192, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

I am running patch 43, I know that patch 44 will hang in about 20 minutes. One 64 bit machine is at hour 50 on patch 43. Monday I will stop the test one of the machines and try to account for the log space.

--Mark.

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

#113 lore raw

Re: [PATCH 44/49] xfs: Reduce allocations during CIL insertion

Quoted 25 lines · Mark Tinguely
Quoted 8 lines · Dave Chinner
Quoted 6 lines · Mark Tinguely

I can reproduce a problem in patch 44 too. It takes my copy test 20 minutes to deplete the log space with patch 44, Same test with patch 43 has been running a day and a half. I do not think that patch 44 is 100 times faster than patch 43 but I will let patch 43 spin all weekend on a couple machines to verify that patch 43 does not hang.

Quoted 7 lines

Details, please. What's your "copy test"?

http://xfs.org/index.php/XFS_FAQ#Q:_What_information_should_I_include_when_reporting_a_problem.3F

Cheers,

Dave.

Micheal found the problem using a simple copy, so I am using copy-like test.

I have hung patch 44 with fsstress but I am currently using the simple perl scripts from bugzilla bug 922, but I do not do the silly step of reducing the log to an abnormal amount.

Just mkfs the filesystem

Quoted 8 lines

Create the the test files. the creation script:
http://oss.sgi.com/bugzilla/attachment.cgi?id=304

Run the test script:
http://oss.sgi.com/bugzilla/attachment.cgi?id=305

          ----

This test seems to stress the log much like xfstest 273 only it runs forever.

Ok, thanks, for the info, Mark. I'll try to reproduce it here. FWIW, we should probably add this to xfstests as a "stress" test. i.e. not part of the auto group, but something that uses the scale parameters to determine runtime. then add all the other tests that have scale parameters to the same group, and if we run ./check --stress <scale> it runs through all the stress tests with that given scale factor...

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

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

Re: [PATCH 44/49] xfs: Reduce allocations during CIL insertion

Quoted 42 lines · Dave Chinner
Quoted 25 lines · Mark Tinguely
Quoted 8 lines · Dave Chinner
Quoted 6 lines · Mark Tinguely

I can reproduce a problem in patch 44 too. It takes my copy test 20 minutes to deplete the log space with patch 44, Same test with patch 43 has been running a day and a half. I do not think that patch 44 is 100 times faster than patch 43 but I will let patch 43 spin all weekend on a couple machines to verify that patch 43 does not hang.

Quoted 7 lines

Details, please. What's your "copy test"?

http://xfs.org/index.php/XFS_FAQ#Q:_What_information_should_I_include_when_reporting_a_problem.3F

Cheers,

Dave.

Micheal found the problem using a simple copy, so I am using copy-like test.

I have hung patch 44 with fsstress but I am currently using the simple perl scripts from bugzilla bug 922, but I do not do the silly step of reducing the log to an abnormal amount.

Just mkfs the filesystem

Quoted 8 lines

Create the the test files. the creation script:

   http://oss.sgi.com/bugzilla/attachment.cgi?id=304

Run the test script:

   http://oss.sgi.com/bugzilla/attachment.cgi?id=305
           ----

This test seems to stress the log much like xfstest 273 only it runs forever.

Ok, thanks, for the info, Mark. I'll try to reproduce it here. FWIW, we should probably add this to xfstests as a "stress" test. i.e. not part of the auto group, but something that uses the scale parameters to determine runtime. then add all the other tests that have scale parameters to the same group, and if we run ./check --stress<scale> it runs through all the stress tests with that given scale factor...

Quoted 3 lines

Cheers,

Dave.

BTW, the long term run of the copy.pl from bug 922 with patch 43 results:

 tail            0x601000055d7
 grant/reserve   0x60100abb200
 ctx t_unit_res  0x834

My log math may be off, tail/reserve diff is 1024, but the CTX holds more than that (2100 bytes).

Looking at patch 44, it is the first time we use the calculation for the number of bytes in patch 43. So I am looking at where the new calculation in iop_size differs from the previous len calculation in xlog_cil_prepare_log_vecs(). So far, I am that inode entry is 140 bytes larger with the new calculation (former len 164 vrs new nbytes 304 type 123b - non-crc filesystem).

I will see if I can substitute the nbytes for len (without triggering the ptr being exceeded assert) to see that will cause the hang.

--Mark.

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

#115 lore raw

Re: [PATCH 44/49] xfs: Reduce allocations during CIL insertion

Quoted 12 lines · Mark Tinguely
Quoted 11 lines · Dave Chinner
Quoted 10 lines · Mark Tinguely
Quoted 9 lines · Dave Chinner
Quoted 6 lines · Mark Tinguely

I can reproduce a problem in patch 44 too. It takes my copy test 20 minutes to deplete the log space with patch 44, Same test with patch 43 has been running a day and a half. I do not think that patch 44 is 100 times faster than patch 43 but I will let patch 43 spin all weekend on a couple machines to verify that patch 43 does not hang.

Details, please. What's your "copy test"?

....

Quoted 10 lines
Quoted 1 line
Quoted 1 line

Micheal found the problem using a simple copy, so I am using copy-like test.

BTW, the long term run of the copy.pl from bug 922 with patch 43 results:

 tail            0x601000055d7
 grant/reserve   0x60100abb200
 ctx t_unit_res  0x834

My log math may be off, tail/reserve diff is 1024, but the CTX holds more than that (2100 bytes).

Quoted 6 lines

Looking at patch 44, it is the first time we use the calculation for the number of bytes in patch 43. So I am looking at where the new calculation in iop_size differs from the previous len calculation in xlog_cil_prepare_log_vecs(). So far, I am that inode entry is 140 bytes larger with the new calculation (former len 164 vrs new nbytes 304 type 123b - non-crc filesystem).

Which size calculation is wrong? t~he one used to size the buffer being allocated - which is intentionally oversized for the inode forks - or the actual size formatted into the buffer, which was unchanged?

I mean, 164 bytes is an inode core (96 bytes) plus a inode log format structure. The increase of 140 bytes indicates that we are logging roughly the entire 256 byte inode - i.e. both forks.

But are you looking at the size returned by iop_size or iop_format? iop_size will be new, iop_format is unchanged by this patchset. indeed, what iop_format returns as vectors is *unchanged* by this patchset, so I think that you are chasing down the wrong path here.

Quoted 3 lines

I will see if I can substitute the nbytes for len (without triggering the ptr being exceeded assert) to see that will cause the hang.

I know what the problem is will be, and that won't fix it. Hint: the buffer is over sized.

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

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

Re: [PATCH 44/49] xfs: Reduce allocations during CIL insertion

Quoted 36 lines · Dave Chinner
Quoted 12 lines · Mark Tinguely
Quoted 11 lines · Dave Chinner
Quoted 10 lines · Mark Tinguely
Quoted 9 lines · Dave Chinner
Quoted 6 lines · Mark Tinguely

I can reproduce a problem in patch 44 too. It takes my copy test 20 minutes to deplete the log space with patch 44, Same test with patch 43 has been running a day and a half. I do not think that patch 44 is 100 times faster than patch 43 but I will let patch 43 spin all weekend on a couple machines to verify that patch 43 does not hang.

Details, please. What's your "copy test"?

....

Quoted 10 lines
Quoted 1 line
Quoted 1 line

Micheal found the problem using a simple copy, so I am using copy-like test.

BTW, the long term run of the copy.pl from bug 922 with patch 43 results:

  tail            0x601000055d7
  grant/reserve   0x60100abb200
  ctx t_unit_res  0x834

My log math may be off, tail/reserve diff is 1024, but the CTX holds more than that (2100 bytes).

Quoted 6 lines

Looking at patch 44, it is the first time we use the calculation for the number of bytes in patch 43. So I am looking at where the new calculation in iop_size differs from the previous len calculation in xlog_cil_prepare_log_vecs(). So far, I am that inode entry is 140 bytes larger with the new calculation (former len 164 vrs new nbytes 304 type 123b - non-crc filesystem).

Which size calculation is wrong? t~he one used to size the buffer being allocated - which is intentionally oversized for the inode forks - or the actual size formatted into the buffer, which was unchanged?

Quoted 9 lines

I mean, 164 bytes is an inode core (96 bytes) plus a inode log format structure. The increase of 140 bytes indicates that we are logging roughly the entire 256 byte inode - i.e. both forks.

But are you looking at the size returned by iop_size or iop_format? iop_size will be new, iop_format is unchanged by this patchset. indeed, what iop_format returns as vectors is *unchanged* by this patchset, so I think that you are chasing down the wrong path here.

164 is the variable len. It is the sum of the xfs_log_iovec.i_len after format.

304 is the result of the iop_size(). starting in patch 44 that is used insteead of len. When we go do the format, we only use 164.

It is the XFS_DINODE_FMT_EXTENTS inode type that generates the extra 140 bytes in xfs_inode_item_size().

In patch 43, use nbytes instead of len like is done in patch 44 and it hangs at the same time and manner than patch 44.

Quoted 10 lines
Quoted 3 lines

I will see if I can substitute the nbytes for len (without triggering the ptr being exceeded assert) to see that will cause the hang.

I know what the problem is will be, and that won't fix it. Hint: the buffer is over sized.

Cheers,

Dave.

--Mark.

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

#117 lore raw

Re: [PATCH 44/49] xfs: Reduce allocations during CIL insertion

Quoted 41 lines · Mark Tinguely
Quoted 40 lines · Dave Chinner
Quoted 12 lines · Mark Tinguely
Quoted 11 lines · Dave Chinner
Quoted 10 lines · Mark Tinguely
Quoted 9 lines · Dave Chinner
Quoted 6 lines · Mark Tinguely

I can reproduce a problem in patch 44 too. It takes my copy test 20 minutes to deplete the log space with patch 44, Same test with patch 43 has been running a day and a half. I do not think that patch 44 is 100 times faster than patch 43 but I will let patch 43 spin all weekend on a couple machines to verify that patch 43 does not hang.

Details, please. What's your "copy test"?

....

Quoted 10 lines
Quoted 1 line
Quoted 1 line

Micheal found the problem using a simple copy, so I am using copy-like test.

BTW, the long term run of the copy.pl from bug 922 with patch 43 results:

 tail            0x601000055d7
 grant/reserve   0x60100abb200
 ctx t_unit_res  0x834

My log math may be off, tail/reserve diff is 1024, but the CTX holds more than that (2100 bytes).

Quoted 6 lines

Looking at patch 44, it is the first time we use the calculation for the number of bytes in patch 43. So I am looking at where the new calculation in iop_size differs from the previous len calculation in xlog_cil_prepare_log_vecs(). So far, I am that inode entry is 140 bytes larger with the new calculation (former len 164 vrs new nbytes 304 type 123b - non-crc filesystem).

Which size calculation is wrong? t~he one used to size the buffer being allocated - which is intentionally oversized for the inode forks - or the actual size formatted into the buffer, which was unchanged?

I mean, 164 bytes is an inode core (96 bytes) plus a inode log format structure. The increase of 140 bytes indicates that we are logging roughly the entire 256 byte inode - i.e. both forks.

Quoted 8 lines
Quoted 5 lines

But are you looking at the size returned by iop_size or iop_format? iop_size will be new, iop_format is unchanged by this patchset. indeed, what iop_format returns as vectors is *unchanged* by this patchset, so I think that you are chasing down the wrong path here.

164 is the variable len. It is the sum of the xfs_log_iovec.i_len after format.

Right.

Quoted 5 lines

304 is the result of the iop_size(). starting in patch 44 that is used insteead of len. When we go do the format, we only use 164.

It is the XFS_DINODE_FMT_EXTENTS inode type that generates the extra 140 bytes in xfs_inode_item_size().

Sure, the changes to iop_size() can return the full size of the inode if the inode forks are in the correct format as it is returns the worst case possible for the given format.

Quoted 2 lines

In patch 43, use nbytes instead of len like is done in patch 44 and it hangs at the same time and manner than patch 44.

nbytes is the size is by iop_size(), and is 304. But there is no "len" parameter in patch 44, so I've got no idea what you are talking about. Can you please use code snippets to show exectly what you are talking about?

I need to know if you worked around the problem I think you have, and the only way I can tell that is if you post the patch that you tested that fixed the problem you were seeing. Posting code that fixes the problem is often the simplest and easiest way to describe the problem being solved....

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

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

PATCH 45/49 xfs: avoid CIL allocation during insert

In reply to Dave Chinner

From: Dave Chinner <[email protected]>

Now that we have the size of the log vector that has been allocated, we can determine if we need to allocate a new log vector for formatting and insertion. We only need to allocate a new vector if it won't fit into the existing buffer.

However, we need to hold the CIL context lock while we do this so that we can't race with a push draining the currently queued log vectors. It is safe to do this as long as we do GFP_NOFS allocation to avoid avoid memory allocation recursing into the filesystem. Hence we can safely overwrite the existing log vector on the CIL if it is large enough to hold all the dirty regions of the current item.

---
 fs/xfs/xfs_log_cil.c | 51 +++++++++++++++++++++++++++++++++------------------
 fs/xfs/xfs_trans.h   |  1 -
 2 files changed, 33 insertions(+), 19 deletions(-)
fs/xfs/xfs_log_cil.c +33 -18
index 08943c8..76ae7d8 100644
@@ -184,6 +184,23 @@ xlog_cil_prepare_log_vecs(
 		buf_size = sizeof(struct xfs_log_vec) + nbytes +
 				niovecs * sizeof(struct xfs_log_iovec);
 
+		/* compare to existing item size */
+		if (lip->li_lv && buf_size <= lip->li_lv->lv_size) {
+			/* same or smaller, optimise common overwrite case */
+			lv = lip->li_lv;
+			lv->lv_next = NULL;
+
+			if (ordered)
+				goto insert;
+
+			/* Ensure the lv is set up according to ->iop_size */
+			lv->lv_niovecs = niovecs;
+			lv->lv_buf = (char *)lv + buf_size - nbytes;
+			lv->lv_buf_len = nbytes;
+			xlog_cil_lv_item_format(lip, lv);
+			goto insert;
+		}
+
 		/* allocate new data chunk */
 		lv = kmem_zalloc(buf_size, KM_SLEEP|KM_NOFS);
 		lv->lv_item = lip;
@@ -229,7 +246,17 @@ xfs_cil_prepare_item(
 {
 	struct xfs_log_vec	*old = lv->lv_item->li_lv;
 
-	if (old) {
+	if (!old) {
+		/* new lv, must pin the log item */
+		ASSERT(!lv->lv_item->li_lv);
+
+		if (lv->lv_buf_len != XFS_LOG_VEC_ORDERED) {
+			*len += lv->lv_buf_len;
+			*diff_iovecs += lv->lv_niovecs;
+		}
+		lv->lv_item->li_ops->iop_pin(lv->lv_item);
+
+	} else if (old != lv) {
 		/* existing lv on log item, space used is a delta */
 		ASSERT((old->lv_buf && old->lv_buf_len && old->lv_niovecs) ||
 			old->lv_buf_len == XFS_LOG_VEC_ORDERED);
@@ -248,15 +275,8 @@ xfs_cil_prepare_item(
 		*diff_iovecs += lv->lv_niovecs - old->lv_niovecs;
 		kmem_free(old);
 	} else {
-		/* new lv, must pin the log item */
-		ASSERT(!lv->lv_item->li_lv);
-
-		if (lv->lv_buf_len != XFS_LOG_VEC_ORDERED) {
-			*len += lv->lv_buf_len;
-			*diff_iovecs += lv->lv_niovecs;
-		}
-		IOP_PIN(lv->lv_item);
-
+		/* re-used lv */
+		/* XXX: can't account for len/diff_iovecs yet */
 	}
 
 	/* attach new log vector to log item */
@@ -732,18 +752,13 @@ xfs_log_commit_cil(
 	if (flags & XFS_TRANS_RELEASE_LOG_RES)
 		log_flags = XFS_LOG_REL_PERM_RESERV;
 
-	/*
-	 * Do all the hard work of formatting items (including memory
-	 * allocation) outside the CIL context lock. This prevents stalling CIL
-	 * pushes when we are low on memory and a transaction commit spends a
-	 * lot of time in memory reclaim.
-	 */
+	/* lock out background commit */
+	down_read(&log->l_cilp->xc_ctx_lock);
+
 	log_vector = xlog_cil_prepare_log_vecs(tp);
 	if (!log_vector)
 		return ENOMEM;
 
-	/* lock out background commit */
-	down_read(&log->l_cilp->xc_ctx_lock);
 	if (commit_lsn)
 		*commit_lsn = log->l_cilp->xc_ctx->sequence;
 
fs/xfs/xfs_trans.h +0 -1
index 24bbdcd..4786170 100644
@@ -77,7 +77,6 @@ struct xfs_item_ops {
 	void (*iop_committing)(xfs_log_item_t *, xfs_lsn_t);
 };
 
-#define IOP_PIN(ip)		(*(ip)->li_ops->iop_pin)(ip)
 #define IOP_UNPIN(ip, remove)	(*(ip)->li_ops->iop_unpin)(ip, remove)
 #define IOP_PUSH(ip, list)	(*(ip)->li_ops->iop_push)(ip, list)
 #define IOP_UNLOCK(ip)		(*(ip)->li_ops->iop_unlock)(ip)
Signature · 6 lines
1.8.3.2

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by on v1 45/49
#119 lore raw

Re: [PATCH 45/49] xfs: avoid CIL allocation during insert

Quoted 15 lines · Dave Chinner

From: Dave Chinner<[email protected]>

Now that we have the size of the log vector that has been allocated, we can determine if we need to allocate a new log vector for formatting and insertion. We only need to allocate a new vector if it won't fit into the existing buffer.

However, we need to hold the CIL context lock while we do this so that we can't race with a push draining the currently queued log vectors. It is safe to do this as long as we do GFP_NOFS allocation to avoid avoid memory allocation recursing into the filesystem. Hence we can safely overwrite the existing log vector on the CIL if it is large enough to hold all the dirty regions of the current item.

Quoted 2 lines

---

back to the CIl commit opt series now that the log space leak has been found..

Looks good - avoid allocation if dirtying existing dirty chunks. Remove the IOP_PIN

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

#120 lore raw

PATCH 46/49 xfs: Combine CIL insert and prepare passes

In reply to Dave Chinner

From: Dave Chinner <[email protected]>

Now that all the log item preparation and formatting is done under the CIL lock, we can get rid of the intermediate log vector chain used to track items to be inserted into the CIL.

We can already find all the items to be committed from the transaction handle, so as long as we attach the log vectors to the item before we insert the items into the CIL, we don't need to create a log vector chain to pass around.

This means we can move all the item insertion code into and optimise it into a pair of simple passes across all the items in the transaction. The first pass does the formatting and accounting, the second inserts them all into the CIL.

We keep this two pass split so that we can separate the CIL insertion - which must be done under the CIL spinlock - from the formatting. We could insert each item into the CIL with a single pass, but that massively increases the number of times we have to grab the CIL spinlock. It is much more efficient (and hence scalable) to do a batch operation and insert all objects in a single lock grab.

---
 fs/xfs/xfs_log_cil.c | 225 ++++++++++++++++++++++-----------------------------
 1 file changed, 97 insertions(+), 128 deletions(-)
fs/xfs/xfs_log_cil.c +97 -128
index 76ae7d8..391cb011 100644
@@ -110,6 +110,52 @@ xlog_cil_lv_item_format(
 }
 
 /*
+ * Prepare the log item for insertion into the CIL. Calculate the difference in
+ * log space and vectors it will consume, and if it is a new item pin it as
+ * well.
+ */
+STATIC void
+xfs_cil_prepare_item(
+	struct xlog		*log,
+	struct xfs_log_vec	*lv,
+	struct xfs_log_vec	*old_lv,
+	int			*diff_len,
+	int			*diff_iovecs)
+{
+	if (!old_lv) {
+		/* new lv, must pin the log item */
+		ASSERT(!lv->lv_item->li_lv);
+
+		if (lv->lv_buf_len != XFS_LOG_VEC_ORDERED) {
+			*diff_len += lv->lv_buf_len;
+			*diff_iovecs += lv->lv_niovecs;
+		}
+		lv->lv_item->li_ops->iop_pin(lv->lv_item);
+
+	} else {
+		/* existing lv on log item, space used is a delta */
+		ASSERT(old_lv->lv_buf_len != lv->lv_buf_len ||
+		       old_lv->lv_niovecs != lv->lv_niovecs);
+		ASSERT(lv->lv_buf_len != XFS_LOG_VEC_ORDERED);
+
+		*diff_len += lv->lv_buf_len - old_lv->lv_buf_len;
+		*diff_iovecs += lv->lv_niovecs - old_lv->lv_niovecs;
+	}
+
+	/* attach new log vector to log item */
+	lv->lv_item->li_lv = lv;
+
+	/*
+	 * If this is the first time the item is being committed to the
+	 * CIL, store the sequence number on the log item so we can
+	 * tell in future commits whether this is the first checkpoint
+	 * the item is being committed into.
+	 */
+	if (!lv->lv_item->li_seq)
+		lv->lv_item->li_seq = log->l_cilp->xc_ctx->sequence;
+}
+
+/*
  * Format log item into a flat buffers
  *
  * For delayed logging, we need to hold a formatted buffer containing all the
@@ -135,24 +181,26 @@ xlog_cil_lv_item_format(
  * format the regions into the iclog as though they are being formatted
  * directly out of the objects themselves.
  */
-static struct xfs_log_vec *
-xlog_cil_prepare_log_vecs(
-	struct xfs_trans	*tp)
+static void
+xlog_cil_insert_format_items(
+	struct xlog		*log,
+	struct xfs_trans	*tp,
+	int			*diff_len,
+	int			*diff_iovecs)
 {
 	struct xfs_log_item_desc *lidp;
-	struct xfs_log_vec	*prev_lv = NULL;
-	struct xfs_log_vec	*ret_lv = NULL;
 
 
 	/* Bail out if we didn't find a log item.  */
 	if (list_empty(&tp->t_items)) {
 		ASSERT(0);
-		return NULL;
+		return;
 	}
 
 	list_for_each_entry(lidp, &tp->t_items, lid_trans) {
 		struct xfs_log_item *lip = lidp->lid_item;
 		struct xfs_log_vec *lv;
+		struct xfs_log_vec *old_lv;
 		int	niovecs = 0;
 		int	nbytes = 0;
 		int	buf_size;
@@ -191,14 +239,17 @@ xlog_cil_prepare_log_vecs(
 			lv->lv_next = NULL;
 
 			if (ordered)
-				goto insert;
+				continue;
 
 			/* Ensure the lv is set up according to ->iop_size */
+			*diff_iovecs += niovecs - lv->lv_niovecs;
+			*diff_len += nbytes - lv->lv_buf_len;
+
 			lv->lv_niovecs = niovecs;
 			lv->lv_buf = (char *)lv + buf_size - nbytes;
 			lv->lv_buf_len = nbytes;
 			xlog_cil_lv_item_format(lip, lv);
-			goto insert;
+			continue;
 		}
 
 		/* allocate new data chunk */
@@ -222,74 +273,13 @@ xlog_cil_prepare_log_vecs(
 
 		xlog_cil_lv_item_format(lip, lv);
 insert:
-		if (!ret_lv)
-			ret_lv = lv;
-		else
-			prev_lv->lv_next = lv;
-		prev_lv = lv;
-	}
-
-	return ret_lv;
-}
-
-/*
- * Prepare the log item for insertion into the CIL. Calculate the difference in
- * log space and vectors it will consume, and if it is a new item pin it as
- * well.
- */
-STATIC void
-xfs_cil_prepare_item(
-	struct xlog		*log,
-	struct xfs_log_vec	*lv,
-	int			*len,
-	int			*diff_iovecs)
-{
-	struct xfs_log_vec	*old = lv->lv_item->li_lv;
+		/* update new CIL space usage */
+		old_lv = lip->li_lv;
+		xfs_cil_prepare_item(log, lv, old_lv, diff_len, diff_iovecs);
 
-	if (!old) {
-		/* new lv, must pin the log item */
-		ASSERT(!lv->lv_item->li_lv);
-
-		if (lv->lv_buf_len != XFS_LOG_VEC_ORDERED) {
-			*len += lv->lv_buf_len;
-			*diff_iovecs += lv->lv_niovecs;
-		}
-		lv->lv_item->li_ops->iop_pin(lv->lv_item);
-
-	} else if (old != lv) {
-		/* existing lv on log item, space used is a delta */
-		ASSERT((old->lv_buf && old->lv_buf_len && old->lv_niovecs) ||
-			old->lv_buf_len == XFS_LOG_VEC_ORDERED);
-
-		/*
-		 * If the new item is ordered, keep the old one that is already
-		 * tracking dirty or ordered regions
-		 */
-		if (lv->lv_buf_len == XFS_LOG_VEC_ORDERED) {
-			ASSERT(!lv->lv_buf);
-			kmem_free(lv);
-			return;
-		}
-
-		*len += lv->lv_buf_len - old->lv_buf_len;
-		*diff_iovecs += lv->lv_niovecs - old->lv_niovecs;
-		kmem_free(old);
-	} else {
-		/* re-used lv */
-		/* XXX: can't account for len/diff_iovecs yet */
+		/* free old lv */
+		kmem_free(old_lv);
 	}
-
-	/* attach new log vector to log item */
-	lv->lv_item->li_lv = lv;
-
-	/*
-	 * If this is the first time the item is being committed to the
-	 * CIL, store the sequence number on the log item so we can
-	 * tell in future commits whether this is the first checkpoint
-	 * the item is being committed into.
-	 */
-	if (!lv->lv_item->li_seq)
-		lv->lv_item->li_seq = log->l_cilp->xc_ctx->sequence;
 }
 
 /*
@@ -302,53 +292,47 @@ xfs_cil_prepare_item(
 static void
 xlog_cil_insert_items(
 	struct xlog		*log,
-	struct xfs_log_vec	*log_vector,
-	struct xlog_ticket	*ticket)
+	struct xfs_trans	*tp)
 {
 	struct xfs_cil		*cil = log->l_cilp;
 	struct xfs_cil_ctx	*ctx = cil->xc_ctx;
-	struct xfs_log_vec	*lv;
+	struct xfs_log_item_desc *lidp;
 	int			len = 0;
 	int			diff_iovecs = 0;
 	int			iclog_space;
 
-	ASSERT(log_vector);
+	ASSERT(tp);
 
 	/*
-	 * Do all the accounting aggregation and switching of log vectors
-	 * around in a separate loop to the insertion of items into the CIL.
-	 * Then we can do a separate loop to update the CIL within a single
-	 * lock/unlock pair. This reduces the number of round trips on the CIL
-	 * lock from O(nr_logvectors) to O(1) and greatly reduces the overall
-	 * hold time for the transaction commit.
-	 *
-	 * If this is the first time the item is being placed into the CIL in
-	 * this context, pin it so it can't be written to disk until the CIL is
-	 * flushed to the iclog and the iclog written to disk.
-	 *
 	 * We can do this safely because the context can't checkpoint until we
 	 * are done so it doesn't matter exactly how we update the CIL.
 	 */
+	xlog_cil_insert_format_items(log, tp, &len, &diff_iovecs);
+
+	/*
+	 * Now (re-)position everything modified at the tail of the CIL.
+	 * We do this here so we only need to take the CIL lock once during
+	 * the transaction commit.
+	 */
 	spin_lock(&cil->xc_cil_lock);
-	for (lv = log_vector; lv; ) {
-		struct xfs_log_vec *next = lv->lv_next;
+	list_for_each_entry(lidp, &tp->t_items, lid_trans) {
+		struct xfs_log_item	*lip = lidp->lid_item;
 
-		ASSERT(lv->lv_item->li_lv || list_empty(&lv->lv_item->li_cil));
-		lv->lv_next = NULL;
+		/* Skip items which aren't dirty in this transaction. */
+		if (!(lidp->lid_flags & XFS_LID_DIRTY))
+			continue;
 
-		/*
-		 * xfs_cil_prepare_item() may free the lv, so move the item on
-		 * the CIL first.
-		 */
-		list_move_tail(&lv->lv_item->li_cil, &cil->xc_cil);
-		xfs_cil_prepare_item(log, lv, &len, &diff_iovecs);
-		lv = next;
+		list_move_tail(&lip->li_cil, &cil->xc_cil);
 	}
 
 	/* account for space used by new iovec headers  */
 	len += diff_iovecs * sizeof(xlog_op_header_t);
 	ctx->nvecs += diff_iovecs;
 
+	/* attach the transaction to the CIL if it has any busy extents */
+	if (!list_empty(&tp->t_busy))
+		list_splice_init(&tp->t_busy, &ctx->busy_extents);
+
 	/*
 	 * Now transfer enough transaction reservation to the context ticket
 	 * for the checkpoint. The context ticket is special - the unit
@@ -357,10 +341,8 @@ xlog_cil_insert_items(
 	 * during the transaction commit.
 	 */
 	if (ctx->ticket->t_curr_res == 0) {
-		/* first commit in checkpoint, steal the header reservation */
-		ASSERT(ticket->t_curr_res >= ctx->ticket->t_unit_res + len);
 		ctx->ticket->t_curr_res = ctx->ticket->t_unit_res;
-		ticket->t_curr_res -= ctx->ticket->t_unit_res;
+		tp->t_ticket->t_curr_res -= ctx->ticket->t_unit_res;
 	}
 
 	/* do we need space for more log record headers? */
@@ -374,10 +356,10 @@ xlog_cil_insert_items(
 		hdrs *= log->l_iclog_hsize + sizeof(struct xlog_op_header);
 		ctx->ticket->t_unit_res += hdrs;
 		ctx->ticket->t_curr_res += hdrs;
-		ticket->t_curr_res -= hdrs;
-		ASSERT(ticket->t_curr_res >= len);
+		tp->t_ticket->t_curr_res -= hdrs;
+		ASSERT(tp->t_ticket->t_curr_res >= len);
 	}
-	ticket->t_curr_res -= len;
+	tp->t_ticket->t_curr_res -= len;
 	ctx->space_used += len;
 
 	spin_unlock(&cil->xc_cil_lock);
@@ -746,38 +728,25 @@ xfs_log_commit_cil(
 	int			flags)
 {
 	struct xlog		*log = mp->m_log;
+	struct xfs_cil		*cil = log->l_cilp;
 	int			log_flags = 0;
-	struct xfs_log_vec	*log_vector;
 
 	if (flags & XFS_TRANS_RELEASE_LOG_RES)
 		log_flags = XFS_LOG_REL_PERM_RESERV;
 
 	/* lock out background commit */
-	down_read(&log->l_cilp->xc_ctx_lock);
+	down_read(&cil->xc_ctx_lock);
 
-	log_vector = xlog_cil_prepare_log_vecs(tp);
-	if (!log_vector)
-		return ENOMEM;
-
-	if (commit_lsn)
-		*commit_lsn = log->l_cilp->xc_ctx->sequence;
-
-	/* xlog_cil_insert_items() destroys log_vector list */
-	xlog_cil_insert_items(log, log_vector, tp->t_ticket);
+	xlog_cil_insert_items(log, tp);
 
 	/* check we didn't blow the reservation */
 	if (tp->t_ticket->t_curr_res < 0)
-		xlog_print_tic_res(log->l_mp, tp->t_ticket);
+		xlog_print_tic_res(mp, tp->t_ticket);
 
-	/* attach the transaction to the CIL if it has any busy extents */
-	if (!list_empty(&tp->t_busy)) {
-		spin_lock(&log->l_cilp->xc_cil_lock);
-		list_splice_init(&tp->t_busy,
-					&log->l_cilp->xc_ctx->busy_extents);
-		spin_unlock(&log->l_cilp->xc_cil_lock);
-	}
+	tp->t_commit_lsn = cil->xc_ctx->sequence;
+	if (commit_lsn)
+		*commit_lsn = tp->t_commit_lsn;
 
-	tp->t_commit_lsn = *commit_lsn;
 	xfs_log_done(mp, tp->t_ticket, NULL, log_flags);
 	xfs_trans_unreserve_and_mod_sb(tp);
 
@@ -792,11 +761,11 @@ xfs_log_commit_cil(
 	 * the log items. This affects (at least) processing of stale buffers,
 	 * inodes and EFIs.
 	 */
-	xfs_trans_free_items(tp, *commit_lsn, 0);
+	xfs_trans_free_items(tp, tp->t_commit_lsn, 0);
 
 	xlog_cil_push_background(log);
 
-	up_read(&log->l_cilp->xc_ctx_lock);
+	up_read(&cil->xc_ctx_lock);
 	return 0;
 }
 
Signature · 6 lines
1.8.3.2

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

Re: [PATCH 46/49] xfs: Combine CIL insert and prepare passes

Quoted 25 lines · Dave Chinner

From: Dave Chinner<[email protected]>

Now that all the log item preparation and formatting is done under the CIL lock, we can get rid of the intermediate log vector chain used to track items to be inserted into the CIL.

We can already find all the items to be committed from the transaction handle, so as long as we attach the log vectors to the item before we insert the items into the CIL, we don't need to create a log vector chain to pass around.

This means we can move all the item insertion code into and optimise it into a pair of simple passes across all the items in the transaction. The first pass does the formatting and accounting, the second inserts them all into the CIL.

We keep this two pass split so that we can separate the CIL insertion - which must be done under the CIL spinlock - from the formatting. We could insert each item into the CIL with a single pass, but that massively increases the number of times we have to grab the CIL spinlock. It is much more efficient (and hence scalable) to do a batch operation and insert all objects in a single lock grab.

...

fs/xfs/xfs_log_cil.c xlog_cil_insert_items( · line 361

Quoted 6 lines
fs/xfs/xfs_log_cil.c +0 -2
@@ -357,10 +341,8 @@ xlog_cil_insert_items(
  	 * during the transaction commit.
  	 */
  	if (ctx->ticket->t_curr_res == 0) {
-		/* first commit in checkpoint, steal the header reservation */
-		ASSERT(ticket->t_curr_res>= ctx->ticket->t_unit_res + len);

^^ is the ctx ticket overflow caught somewhere else? ^^^^

fs/xfs/xfs_log_cil.c xlog_cil_insert_items( · line 347

Quoted 5 lines
fs/xfs/xfs_log_cil.c +1 -1
  		ctx->ticket->t_curr_res = ctx->ticket->t_unit_res;
-		ticket->t_curr_res -= ctx->ticket->t_unit_res;
+		tp->t_ticket->t_curr_res -= ctx->ticket->t_unit_res;
  	}
 

Thanks,

--Mark.

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

#122 lore raw

Re: [PATCH 46/49] xfs: Combine CIL insert and prepare passes

Quoted 29 lines · Mark Tinguely
Quoted 25 lines · Dave Chinner

From: Dave Chinner<[email protected]>

Now that all the log item preparation and formatting is done under the CIL lock, we can get rid of the intermediate log vector chain used to track items to be inserted into the CIL.

We can already find all the items to be committed from the transaction handle, so as long as we attach the log vectors to the item before we insert the items into the CIL, we don't need to create a log vector chain to pass around.

This means we can move all the item insertion code into and optimise it into a pair of simple passes across all the items in the transaction. The first pass does the formatting and accounting, the second inserts them all into the CIL.

We keep this two pass split so that we can separate the CIL insertion - which must be done under the CIL spinlock - from the formatting. We could insert each item into the CIL with a single pass, but that massively increases the number of times we have to grab the CIL spinlock. It is much more efficient (and hence scalable) to do a batch operation and insert all objects in a single lock grab.

...

Quoted 8 lines

fs/xfs/xfs_log_cil.c xlog_cil_insert_items( · line 361

Quoted 6 lines
fs/xfs/xfs_log_cil.c +0 -2
@@ -357,10 +341,8 @@ xlog_cil_insert_items(
 	 * during the transaction commit.
 	 */
 	if (ctx->ticket->t_curr_res == 0) {
-		/* first commit in checkpoint, steal the header reservation */
-		ASSERT(ticket->t_curr_res>= ctx->ticket->t_unit_res + len);

^^ is the ctx ticket overflow caught somewhere else? ^^^^

Of course. It's caught in same check that catches all other transaction overruns - in the caller after this function returns. And it prints the ticket now, too, which means it's a far more functional check that the current one...

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by on v1 46/49
#123 lore raw

Re: [PATCH 46/49] xfs: Combine CIL insert and prepare passes

In reply to Dave Chinner
Quoted 24 lines · Dave Chinner

From: Dave Chinner<[email protected]>

Now that all the log item preparation and formatting is done under the CIL lock, we can get rid of the intermediate log vector chain used to track items to be inserted into the CIL.

We can already find all the items to be committed from the transaction handle, so as long as we attach the log vectors to the item before we insert the items into the CIL, we don't need to create a log vector chain to pass around.

This means we can move all the item insertion code into and optimise it into a pair of simple passes across all the items in the transaction. The first pass does the formatting and accounting, the second inserts them all into the CIL.

We keep this two pass split so that we can separate the CIL insertion - which must be done under the CIL spinlock - from the formatting. We could insert each item into the CIL with a single pass, but that massively increases the number of times we have to grab the CIL spinlock. It is much more efficient (and hence scalable) to do a batch operation and insert all objects in a single lock grab.

Quoted 2 lines

---

Removed the old log commit vector chain interface.

Looks good. Still like the additional assert for cil space stealing.

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

#124 lore raw

PATCH 47/49 xfs: split the CIL lock

In reply to Dave Chinner

From: Dave Chinner <[email protected]>

The xc_cil_lock is used for two purposes - to protect the CIL itself, and to protect the push/commit state and lists. These are two logically separate structures and operations, so can have their own locks. This means that pushing on the CIL and the commit wait ordering won't contend for a lock with other transactions that are completing concurrently. As the CIL insertion is the hottest path throught eh CIL, this is a big win.

---
 fs/xfs/xfs_log_cil.c  | 41 +++++++++++++++++++++--------------------
 fs/xfs/xfs_log_priv.h |  9 ++++++---
 2 files changed, 27 insertions(+), 23 deletions(-)
fs/xfs/xfs_log_cil.c +21 -20
index 391cb011..ecc2402 100644
@@ -398,9 +398,9 @@ xlog_cil_committed(
 	xfs_extent_busy_clear(mp, &ctx->busy_extents,
 			     (mp->m_flags & XFS_MOUNT_DISCARD) && !abort);
 
-	spin_lock(&ctx->cil->xc_cil_lock);
+	spin_lock(&ctx->cil->xc_push_lock);
 	list_del(&ctx->committing);
-	spin_unlock(&ctx->cil->xc_cil_lock);
+	spin_unlock(&ctx->cil->xc_push_lock);
 
 	xlog_cil_free_logvec(ctx->lv_chain);
 
@@ -455,7 +455,7 @@ xlog_cil_push(
 	down_write(&cil->xc_ctx_lock);
 	ctx = cil->xc_ctx;
 
-	spin_lock(&cil->xc_cil_lock);
+	spin_lock(&cil->xc_push_lock);
 	push_seq = cil->xc_push_seq;
 	ASSERT(push_seq <= ctx->sequence);
 
@@ -466,10 +466,10 @@ xlog_cil_push(
 	 */
 	if (list_empty(&cil->xc_cil)) {
 		cil->xc_push_seq = 0;
-		spin_unlock(&cil->xc_cil_lock);
+		spin_unlock(&cil->xc_push_lock);
 		goto out_skip;
 	}
-	spin_unlock(&cil->xc_cil_lock);
+	spin_unlock(&cil->xc_push_lock);
 
 
 	/* check for a previously pushed seqeunce */
@@ -537,9 +537,9 @@ xlog_cil_push(
 	 * that higher sequences will wait for us to write out a commit record
 	 * before they do.
 	 */
-	spin_lock(&cil->xc_cil_lock);
+	spin_lock(&cil->xc_push_lock);
 	list_add(&ctx->committing, &cil->xc_committing);
-	spin_unlock(&cil->xc_cil_lock);
+	spin_unlock(&cil->xc_push_lock);
 	up_write(&cil->xc_ctx_lock);
 
 	/*
@@ -574,7 +574,7 @@ xlog_cil_push(
 	 * order the commit records so replay will get them in the right order.
 	 */
 restart:
-	spin_lock(&cil->xc_cil_lock);
+	spin_lock(&cil->xc_push_lock);
 	list_for_each_entry(new_ctx, &cil->xc_committing, committing) {
 		/*
 		 * Higher sequences will wait for this one so skip them.
@@ -587,11 +587,11 @@ restart:
 			 * It is still being pushed! Wait for the push to
 			 * complete, then start again from the beginning.
 			 */
-			xlog_wait(&cil->xc_commit_wait, &cil->xc_cil_lock);
+			xlog_wait(&cil->xc_commit_wait, &cil->xc_push_lock);
 			goto restart;
 		}
 	}
-	spin_unlock(&cil->xc_cil_lock);
+	spin_unlock(&cil->xc_push_lock);
 
 	/* xfs_log_done always frees the ticket on error. */
 	commit_lsn = xfs_log_done(log->l_mp, tic, &commit_iclog, 0);
@@ -610,10 +610,10 @@ restart:
 	 * callbacks to the iclog we can assign the commit LSN to the context
 	 * and wake up anyone who is waiting for the commit to complete.
 	 */
-	spin_lock(&cil->xc_cil_lock);
+	spin_lock(&cil->xc_push_lock);
 	ctx->commit_lsn = commit_lsn;
 	wake_up_all(&cil->xc_commit_wait);
-	spin_unlock(&cil->xc_cil_lock);
+	spin_unlock(&cil->xc_push_lock);
 
 	/* release the hounds! */
 	return xfs_log_release_iclog(log->l_mp, commit_iclog);
@@ -666,12 +666,12 @@ xlog_cil_push_background(
 	if (cil->xc_ctx->space_used < XLOG_CIL_SPACE_LIMIT(log))
 		return;
 
-	spin_lock(&cil->xc_cil_lock);
+	spin_lock(&cil->xc_push_lock);
 	if (cil->xc_push_seq < cil->xc_current_sequence) {
 		cil->xc_push_seq = cil->xc_current_sequence;
 		queue_work(log->l_mp->m_cil_workqueue, &cil->xc_push_work);
 	}
-	spin_unlock(&cil->xc_cil_lock);
+	spin_unlock(&cil->xc_push_lock);
 
 }
 
@@ -694,14 +694,14 @@ xlog_cil_push_foreground(
 	 * If the CIL is empty or we've already pushed the sequence then
 	 * there's no work we need to do.
 	 */
-	spin_lock(&cil->xc_cil_lock);
+	spin_lock(&cil->xc_push_lock);
 	if (list_empty(&cil->xc_cil) || push_seq <= cil->xc_push_seq) {
-		spin_unlock(&cil->xc_cil_lock);
+		spin_unlock(&cil->xc_push_lock);
 		return;
 	}
 
 	cil->xc_push_seq = push_seq;
-	spin_unlock(&cil->xc_cil_lock);
+	spin_unlock(&cil->xc_push_lock);
 
 	/* do the push now */
 	xlog_cil_push(log);
@@ -804,7 +804,7 @@ xlog_cil_force_lsn(
 	 * on commits for those as well.
 	 */
 restart:
-	spin_lock(&cil->xc_cil_lock);
+	spin_lock(&cil->xc_push_lock);
 	list_for_each_entry(ctx, &cil->xc_committing, committing) {
 		if (ctx->sequence > sequence)
 			continue;
@@ -813,7 +813,7 @@ restart:
 			 * It is still being pushed! Wait for the push to
 			 * complete, then start again from the beginning.
 			 */
-			xlog_wait(&cil->xc_commit_wait, &cil->xc_cil_lock);
+			xlog_wait(&cil->xc_commit_wait, &cil->xc_push_lock);
 			goto restart;
 		}
 		if (ctx->sequence != sequence)
@@ -821,7 +821,7 @@ restart:
 		/* found it! */
 		commit_lsn = ctx->commit_lsn;
 	}
-	spin_unlock(&cil->xc_cil_lock);
+	spin_unlock(&cil->xc_push_lock);
 	return commit_lsn;
 }
 
@@ -879,6 +879,7 @@ xlog_cil_init(
 	INIT_LIST_HEAD(&cil->xc_cil);
 	INIT_LIST_HEAD(&cil->xc_committing);
 	spin_lock_init(&cil->xc_cil_lock);
+	spin_lock_init(&cil->xc_push_lock);
 	init_rwsem(&cil->xc_ctx_lock);
 	init_waitqueue_head(&cil->xc_commit_wait);
 
fs/xfs/xfs_log_priv.h +6 -3
index edd0964..136654b 100644
@@ -278,14 +278,17 @@ struct xfs_cil {
 	struct xlog		*xc_log;
 	struct list_head	xc_cil;
 	spinlock_t		xc_cil_lock;
+
+	struct rw_semaphore	xc_ctx_lock ____cacheline_aligned_in_smp;
 	struct xfs_cil_ctx	*xc_ctx;
-	struct rw_semaphore	xc_ctx_lock;
+
+	spinlock_t		xc_push_lock ____cacheline_aligned_in_smp;
+	xfs_lsn_t		xc_push_seq;
 	struct list_head	xc_committing;
 	wait_queue_head_t	xc_commit_wait;
 	xfs_lsn_t		xc_current_sequence;
 	struct work_struct	xc_push_work;
-	xfs_lsn_t		xc_push_seq;
-};
+} ____cacheline_aligned_in_smp;
 
 /*
  * The amount of log space we allow the CIL to aggregate is difficult to size.
Signature · 6 lines
1.8.3.2

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

Re: [PATCH 47/49] xfs: split the CIL lock

Quoted 10 lines · Dave Chinner

From: Dave Chinner<[email protected]>

The xc_cil_lock is used for two purposes - to protect the CIL itself, and to protect the push/commit state and lists. These are two logically separate structures and operations, so can have their own locks. This means that pushing on the CIL and the commit wait ordering won't contend for a lock with other transactions that are completing concurrently. As the CIL insertion is the hottest path throught eh CIL, this is a big win.

Quoted 2 lines

---

read semaphore/xc_cil_lock (original lock) protects cil entries write semaphore/xc_push_lock (new lock) protects the cil push

Looks good.

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

#126 lore raw

PATCH 48/49 xfs: Add read-only support for dirent filetype field

In reply to Dave Chinner

From: Dave Chinner <[email protected]>

Add support for the file type field in directory entries so that readdir can return the type of the inode the dirent points to to userspace without first having to read the inode off disk.

The encoding of the type field is a single byte that is added to the end of the directory entry name length. For all intents and purposes, it appends a "hidden" byte to the name field which contains the type information. As the directory entry is already of dynamic size, helpers are already required to access and decode the direct entry structures.

Hence the relevent extraction and iteration helpers are updated to understand the hidden byte. Helpers for reading and writing the filetype field from the directory entries are also added. Only the read helpers are used by this patch. It also adds all the code necessary to read the type information out of the dirents on disk.

Further we add the superblock feature bit and helpers to indicate that we understand the on-disk format change. This is not a compatible change - existing kernels cannot read the new format successfully - so an incompatible feature flag is added. We don't yet allow filesystems to mount with this flag yet - that will be added once write support is added.

Finally, the code to take the type from the VFS, convert it to an XFS on-disk type and put it into the xfs_name structures passed around is added, but the directory code does not use this field yet. That will be in the next patch.

---
 fs/xfs/xfs_da_btree.h     |   1 +
 fs/xfs/xfs_dir2.c         |   5 +-
 fs/xfs/xfs_dir2.h         |   4 +-
 fs/xfs/xfs_dir2_block.c   |  16 ++--
 fs/xfs/xfs_dir2_data.c    |  13 ++--
 fs/xfs/xfs_dir2_format.h  | 183 ++++++++++++++++++++++++++++++++++++++++------
 fs/xfs/xfs_dir2_leaf.c    |   6 +-
 fs/xfs/xfs_dir2_node.c    |   8 +-
 fs/xfs/xfs_dir2_priv.h    |   9 +++
 fs/xfs/xfs_dir2_readdir.c |  69 ++++++++++++++---
 fs/xfs/xfs_dir2_sf.c      | 121 +++++++++++++++++-------------
 fs/xfs/xfs_iops.c         |  27 ++++---
 fs/xfs/xfs_sb.h           |  28 ++++---
 fs/xfs/xfs_types.h        |   1 +
 14 files changed, 365 insertions(+), 126 deletions(-)
fs/xfs/xfs_da_btree.h +1 -0
index 6fb3371..8cdc77b 100644
@@ -176,6 +176,7 @@ enum xfs_dacmp {
 typedef struct xfs_da_args {
 	const __uint8_t	*name;		/* string (maybe not NULL terminated) */
 	int		namelen;	/* length of string (maybe no NULL) */
+	__uint8_t	filetype;	/* filetype of inode for directories */
 	__uint8_t	*value;		/* set of bytes (maybe contain NULLs) */
 	int		valuelen;	/* length of value */
 	int		flags;		/* argument flags (eg: ATTR_NOCREATE) */
fs/xfs/xfs_dir2.c +4 -1
index 841933c..f9825b1 100644
@@ -37,7 +37,8 @@
 #include "xfs_error.h"
 #include "xfs_trace.h"
 
-struct xfs_name xfs_name_dotdot = { (unsigned char *)"..", 2};
+struct xfs_name xfs_name_dotdot = { (unsigned char *)"..", 2, XFS_DIR3_FT_DIR };
+
 
 /*
  * ASCII case-insensitive (ie. A-Z) support for directories that was
@@ -386,6 +387,7 @@ xfs_dir_replace(
 	memset(&args, 0, sizeof(xfs_da_args_t));
 	args.name = name->name;
 	args.namelen = name->len;
+	args.filetype = name->type;
 	args.hashval = dp->i_mount->m_dirnameops->hashname(name);
 	args.inumber = inum;
 	args.dp = dp;
@@ -433,6 +435,7 @@ xfs_dir_canenter(
 	memset(&args, 0, sizeof(xfs_da_args_t));
 	args.name = name->name;
 	args.namelen = name->len;
+	args.filetype = name->type;
 	args.hashval = dp->i_mount->m_dirnameops->hashname(name);
 	args.dp = dp;
 	args.whichfork = XFS_DATA_FORK;
fs/xfs/xfs_dir2.h +2 -2
index 7fe2b8f..768ddad 100644
@@ -68,8 +68,8 @@ extern int xfs_dir2_sf_to_block(struct xfs_da_args *args);
 extern xfs_ino_t xfs_dir2_sf_get_parent_ino(struct xfs_dir2_sf_hdr *sfp);
 extern void xfs_dir2_sf_put_parent_ino(struct xfs_dir2_sf_hdr *sfp,
 		xfs_ino_t ino);
-extern xfs_ino_t xfs_dir2_sfe_get_ino(struct xfs_dir2_sf_hdr *sfp,
-		struct xfs_dir2_sf_entry *sfep);
+extern xfs_ino_t xfs_dir3_sfe_get_ino(struct xfs_mount *mp,
+		struct xfs_dir2_sf_hdr *sfp, struct xfs_dir2_sf_entry *sfep);
 extern void xfs_dir2_sfe_put_ino( struct xfs_dir2_sf_hdr *,
 		struct xfs_dir2_sf_entry *sfep, xfs_ino_t ino);
 
fs/xfs/xfs_dir2_block.c +8 -8
index becd69f..1cd2f56 100644
@@ -369,7 +369,7 @@ xfs_dir2_block_addname(
 	if (error)
 		return error;
 
-	len = xfs_dir2_data_entsize(args->namelen);
+	len = xfs_dir3_data_entsize(mp, args->namelen);
 
 	/*
 	 * Set up pointers to parts of the block.
@@ -549,7 +549,7 @@ xfs_dir2_block_addname(
 	dep->inumber = cpu_to_be64(args->inumber);
 	dep->namelen = args->namelen;
 	memcpy(dep->name, args->name, args->namelen);
-	tagp = xfs_dir2_data_entry_tag_p(dep);
+	tagp = xfs_dir3_data_entry_tag_p(mp, dep);
 	*tagp = cpu_to_be16((char *)dep - (char *)hdr);
 	/*
 	 * Clean up the bestfree array and log the header, tail, and entry.
@@ -799,7 +799,7 @@ xfs_dir2_block_removename(
 	needlog = needscan = 0;
 	xfs_dir2_data_make_free(tp, bp,
 		(xfs_dir2_data_aoff_t)((char *)dep - (char *)hdr),
-		xfs_dir2_data_entsize(dep->namelen), &needlog, &needscan);
+		xfs_dir3_data_entsize(mp, dep->namelen), &needlog, &needscan);
 	/*
 	 * Fix up the block tail.
 	 */
@@ -1159,7 +1159,7 @@ xfs_dir2_sf_to_block(
 	dep->inumber = cpu_to_be64(dp->i_ino);
 	dep->namelen = 1;
 	dep->name[0] = '.';
-	tagp = xfs_dir2_data_entry_tag_p(dep);
+	tagp = xfs_dir3_data_entry_tag_p(mp, dep);
 	*tagp = cpu_to_be16((char *)dep - (char *)hdr);
 	xfs_dir2_data_log_entry(tp, bp, dep);
 	blp[0].hashval = cpu_to_be32(xfs_dir_hash_dot);
@@ -1172,7 +1172,7 @@ xfs_dir2_sf_to_block(
 	dep->inumber = cpu_to_be64(xfs_dir2_sf_get_parent_ino(sfp));
 	dep->namelen = 2;
 	dep->name[0] = dep->name[1] = '.';
-	tagp = xfs_dir2_data_entry_tag_p(dep);
+	tagp = xfs_dir3_data_entry_tag_p(mp, dep);
 	*tagp = cpu_to_be16((char *)dep - (char *)hdr);
 	xfs_dir2_data_log_entry(tp, bp, dep);
 	blp[1].hashval = cpu_to_be32(xfs_dir_hash_dotdot);
@@ -1217,10 +1217,10 @@ xfs_dir2_sf_to_block(
 		 * Copy a real entry.
 		 */
 		dep = (xfs_dir2_data_entry_t *)((char *)hdr + newoffset);
-		dep->inumber = cpu_to_be64(xfs_dir2_sfe_get_ino(sfp, sfep));
+		dep->inumber = cpu_to_be64(xfs_dir3_sfe_get_ino(mp, sfp, sfep));
 		dep->namelen = sfep->namelen;
 		memcpy(dep->name, sfep->name, dep->namelen);
-		tagp = xfs_dir2_data_entry_tag_p(dep);
+		tagp = xfs_dir3_data_entry_tag_p(mp, dep);
 		*tagp = cpu_to_be16((char *)dep - (char *)hdr);
 		xfs_dir2_data_log_entry(tp, bp, dep);
 		name.name = sfep->name;
@@ -1233,7 +1233,7 @@ xfs_dir2_sf_to_block(
 		if (++i == sfp->count)
 			sfep = NULL;
 		else
-			sfep = xfs_dir2_sf_nextentry(sfp, sfep);
+			sfep = xfs_dir3_sf_nextentry(mp, sfp, sfep);
 	}
 	/* Done with the temporary buffer */
 	kmem_free(sfp);
fs/xfs/xfs_dir2_data.c +7 -6
index 98c23fa..1b59e43 100644
@@ -147,7 +147,7 @@ __xfs_dir3_data_check(
 		XFS_WANT_CORRUPTED_RETURN(
 			!xfs_dir_ino_validate(mp, be64_to_cpu(dep->inumber)));
 		XFS_WANT_CORRUPTED_RETURN(
-			be16_to_cpu(*xfs_dir2_data_entry_tag_p(dep)) ==
+			be16_to_cpu(*xfs_dir3_data_entry_tag_p(mp, dep)) ==
 					       (char *)dep - (char *)hdr);
 		count++;
 		lastfree = 0;
@@ -166,7 +166,7 @@ __xfs_dir3_data_check(
 			}
 			XFS_WANT_CORRUPTED_RETURN(i < be32_to_cpu(btp->count));
 		}
-		p += xfs_dir2_data_entsize(dep->namelen);
+		p += xfs_dir3_data_entsize(mp, dep->namelen);
 	}
 	/*
 	 * Need to have seen all the entries and all the bestfree slots.
@@ -536,8 +536,8 @@ xfs_dir2_data_freescan(
 		else {
 			dep = (xfs_dir2_data_entry_t *)p;
 			ASSERT((char *)dep - (char *)hdr ==
-			       be16_to_cpu(*xfs_dir2_data_entry_tag_p(dep)));
-			p += xfs_dir2_data_entsize(dep->namelen);
+			       be16_to_cpu(*xfs_dir3_data_entry_tag_p(mp, dep)));
+			p += xfs_dir3_data_entsize(mp, dep->namelen);
 		}
 	}
 }
@@ -627,7 +627,8 @@ xfs_dir2_data_log_entry(
 	struct xfs_buf		*bp,
 	xfs_dir2_data_entry_t	*dep)		/* data entry pointer */
 {
-	xfs_dir2_data_hdr_t	*hdr = bp->b_addr;
+	struct xfs_dir2_data_hdr *hdr = bp->b_addr;
+	struct xfs_mount	*mp = tp->t_mountp;
 
 	ASSERT(hdr->magic == cpu_to_be32(XFS_DIR2_DATA_MAGIC) ||
 	       hdr->magic == cpu_to_be32(XFS_DIR3_DATA_MAGIC) ||
@@ -635,7 +636,7 @@ xfs_dir2_data_log_entry(
 	       hdr->magic == cpu_to_be32(XFS_DIR3_BLOCK_MAGIC));
 
 	xfs_trans_log_buf(tp, bp, (uint)((char *)dep - (char *)hdr),
-		(uint)((char *)(xfs_dir2_data_entry_tag_p(dep) + 1) -
+		(uint)((char *)(xfs_dir3_data_entry_tag_p(mp, dep) + 1) -
 		       (char *)hdr - 1));
 }
 
fs/xfs/xfs_dir2_format.h +160 -23

260 lines not on this page · raw message

fs/xfs/xfs_dir2_leaf.c +3 -3
index 591eaf2..887b1bd 100644
@@ -696,7 +696,7 @@ xfs_dir2_leaf_addname(
 	ents = xfs_dir3_leaf_ents_p(leaf);
 	xfs_dir3_leaf_hdr_from_disk(&leafhdr, leaf);
 	bestsp = xfs_dir2_leaf_bests_p(ltp);
-	length = xfs_dir2_data_entsize(args->namelen);
+	length = xfs_dir3_data_entsize(mp, args->namelen);
 
 	/*
 	 * See if there are any entries with the same hash value
@@ -897,7 +897,7 @@ xfs_dir2_leaf_addname(
 	dep->inumber = cpu_to_be64(args->inumber);
 	dep->namelen = args->namelen;
 	memcpy(dep->name, args->name, dep->namelen);
-	tagp = xfs_dir2_data_entry_tag_p(dep);
+	tagp = xfs_dir3_data_entry_tag_p(mp, dep);
 	*tagp = cpu_to_be16((char *)dep - (char *)hdr);
 	/*
 	 * Need to scan fix up the bestfree table.
@@ -1427,7 +1427,7 @@ xfs_dir2_leaf_removename(
 	 */
 	xfs_dir2_data_make_free(tp, dbp,
 		(xfs_dir2_data_aoff_t)((char *)dep - (char *)hdr),
-		xfs_dir2_data_entsize(dep->namelen), &needlog, &needscan);
+		xfs_dir3_data_entsize(mp, dep->namelen), &needlog, &needscan);
 	/*
 	 * We just mark the leaf entry stale by putting a null in it.
 	 */
fs/xfs/xfs_dir2_node.c +4 -4
index 18e287d..49f1e9e 100644
@@ -605,7 +605,7 @@ xfs_dir2_leafn_lookup_for_addname(
 		ASSERT(free->hdr.magic == cpu_to_be32(XFS_DIR2_FREE_MAGIC) ||
 		       free->hdr.magic == cpu_to_be32(XFS_DIR3_FREE_MAGIC));
 	}
-	length = xfs_dir2_data_entsize(args->namelen);
+	length = xfs_dir3_data_entsize(mp, args->namelen);
 	/*
 	 * Loop over leaf entries with the right hash value.
 	 */
@@ -1259,7 +1259,7 @@ xfs_dir2_leafn_remove(
 	longest = be16_to_cpu(bf[0].length);
 	needlog = needscan = 0;
 	xfs_dir2_data_make_free(tp, dbp, off,
-		xfs_dir2_data_entsize(dep->namelen), &needlog, &needscan);
+		xfs_dir3_data_entsize(mp, dep->namelen), &needlog, &needscan);
 	/*
 	 * Rescan the data block freespaces for bestfree.
 	 * Log the data block header if needed.
@@ -1711,7 +1711,7 @@ xfs_dir2_node_addname_int(
 	dp = args->dp;
 	mp = dp->i_mount;
 	tp = args->trans;
-	length = xfs_dir2_data_entsize(args->namelen);
+	length = xfs_dir3_data_entsize(mp, args->namelen);
 	/*
 	 * If we came in with a freespace block that means that lookup
 	 * found an entry with our hash value.  This is the freespace
@@ -2007,7 +2007,7 @@ xfs_dir2_node_addname_int(
 	dep->inumber = cpu_to_be64(args->inumber);
 	dep->namelen = args->namelen;
 	memcpy(dep->name, args->name, dep->namelen);
-	tagp = xfs_dir2_data_entry_tag_p(dep);
+	tagp = xfs_dir3_data_entry_tag_p(mp, dep);
 	*tagp = cpu_to_be16((char *)dep - (char *)hdr);
 	xfs_dir2_data_log_entry(tp, dbp, dep);
 	/*
fs/xfs/xfs_dir2_priv.h +9 -0
index 6d2a99c2..1bad84c 100644
@@ -18,6 +18,8 @@
 #ifndef __XFS_DIR2_PRIV_H__
 #define __XFS_DIR2_PRIV_H__
 
+struct dir_context;
+
 /* xfs_dir2.c */
 extern int xfs_dir_ino_validate(struct xfs_mount *mp, xfs_ino_t ino);
 extern int xfs_dir2_grow_inode(struct xfs_da_args *args, int space,
@@ -25,6 +27,13 @@ extern int xfs_dir2_grow_inode(struct xfs_da_args *args, int space,
 extern int xfs_dir_cilookup_result(struct xfs_da_args *args,
 				const unsigned char *name, int len);
 
+#define S_SHIFT 12
+extern const unsigned char xfs_mode_to_ftype[];
+
+extern unsigned char xfs_dir3_get_dtype(struct xfs_mount *mp,
+					__uint8_t filetype);
+
+
 /* xfs_dir2_block.c */
 extern int xfs_dir3_block_read(struct xfs_trans *tp, struct xfs_inode *dp,
 			       struct xfs_buf **bpp);
fs/xfs/xfs_dir2_readdir.c +59 -10

133 lines not on this page · raw message

fs/xfs/xfs_dir2_sf.c +72 -49

312 lines not on this page · raw message

fs/xfs/xfs_iops.c +16 -11
index 82c5a5d..b250495 100644
@@ -40,6 +40,9 @@
 #include "xfs_trace.h"
 #include "xfs_icache.h"
 #include "xfs_symlink.h"
+#include "xfs_da_btree.h"
+#include "xfs_dir2_format.h"
+#include "xfs_dir2_priv.h"
 
 #include <linux/capability.h>
 #include <linux/xattr.h>
@@ -88,10 +91,12 @@ xfs_init_security(
 static void
 xfs_dentry_to_name(
 	struct xfs_name	*namep,
-	struct dentry	*dentry)
+	struct dentry	*dentry,
+	int		mode)
 {
 	namep->name = dentry->d_name.name;
 	namep->len = dentry->d_name.len;
+	namep->type = xfs_mode_to_ftype[(mode & S_IFMT) >> S_SHIFT];
 }
 
 STATIC void
@@ -107,7 +112,7 @@ xfs_cleanup_inode(
 	 * xfs_init_security we must back out.
 	 * ENOSPC can hit here, among other things.
 	 */
-	xfs_dentry_to_name(&teardown, dentry);
+	xfs_dentry_to_name(&teardown, dentry, 0);
 
 	xfs_remove(XFS_I(dir), &teardown, XFS_I(inode));
 	iput(inode);
@@ -147,7 +152,7 @@ xfs_vn_mknod(
 			mode &= ~current_umask();
 	}
 
-	xfs_dentry_to_name(&name, dentry);
+	xfs_dentry_to_name(&name, dentry, mode);
 	error = xfs_create(XFS_I(dir), &name, mode, rdev, &ip);
 	if (unlikely(error))
 		goto out_free_acl;
@@ -208,7 +213,7 @@ xfs_vn_lookup(
 	if (dentry->d_name.len >= MAXNAMELEN)
 		return ERR_PTR(-ENAMETOOLONG);
 
-	xfs_dentry_to_name(&name, dentry);
+	xfs_dentry_to_name(&name, dentry, 0);
 	error = xfs_lookup(XFS_I(dir), &name, &cip, NULL);
 	if (unlikely(error)) {
 		if (unlikely(error != ENOENT))
@@ -235,7 +240,7 @@ xfs_vn_ci_lookup(
 	if (dentry->d_name.len >= MAXNAMELEN)
 		return ERR_PTR(-ENAMETOOLONG);
 
-	xfs_dentry_to_name(&xname, dentry);
+	xfs_dentry_to_name(&xname, dentry, 0);
 	error = xfs_lookup(XFS_I(dir), &xname, &ip, &ci_name);
 	if (unlikely(error)) {
 		if (unlikely(error != ENOENT))
@@ -270,7 +275,7 @@ xfs_vn_link(
 	struct xfs_name	name;
 	int		error;
 
-	xfs_dentry_to_name(&name, dentry);
+	xfs_dentry_to_name(&name, dentry, inode->i_mode);
 
 	error = xfs_link(XFS_I(dir), XFS_I(inode), &name);
 	if (unlikely(error))
@@ -289,7 +294,7 @@ xfs_vn_unlink(
 	struct xfs_name	name;
 	int		error;
 
-	xfs_dentry_to_name(&name, dentry);
+	xfs_dentry_to_name(&name, dentry, 0);
 
 	error = -xfs_remove(XFS_I(dir), &name, XFS_I(dentry->d_inode));
 	if (error)
@@ -319,7 +324,7 @@ xfs_vn_symlink(
 
 	mode = S_IFLNK |
 		(irix_symlink_mode ? 0777 & ~current_umask() : S_IRWXUGO);
-	xfs_dentry_to_name(&name, dentry);
+	xfs_dentry_to_name(&name, dentry, mode);
 
 	error = xfs_symlink(XFS_I(dir), &name, symname, mode, &cip);
 	if (unlikely(error))
@@ -351,12 +356,12 @@ xfs_vn_rename(
 	struct xfs_name	oname;
 	struct xfs_name	nname;
 
-	xfs_dentry_to_name(&oname, odentry);
-	xfs_dentry_to_name(&nname, ndentry);
+	xfs_dentry_to_name(&oname, odentry, 0);
+	xfs_dentry_to_name(&nname, ndentry, odentry->d_inode->i_mode);
 
 	return -xfs_rename(XFS_I(odir), &oname, XFS_I(odentry->d_inode),
 			   XFS_I(ndir), &nname, new_inode ?
-			   			XFS_I(new_inode) : NULL);
+						XFS_I(new_inode) : NULL);
 }
 
 /*
fs/xfs/xfs_sb.h +19 -9
index d6f3648..c5b1c04 100644
@@ -555,12 +555,6 @@ static inline void xfs_sb_version_addprojid32bit(xfs_sb_t *sbp)
 	sbp->sb_bad_features2 |= XFS_SB_VERSION2_PROJID32BIT;
 }
 
-static inline int xfs_sb_version_hascrc(xfs_sb_t *sbp)
-{
-	return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5;
-}
-
-
 /*
  * Extended v5 superblock feature masks. These are to be used for new v5
  * superblock features only.
@@ -599,7 +593,9 @@ xfs_sb_has_ro_compat_feature(
 	return (sbp->sb_features_ro_compat & feature) != 0;
 }
 
+#define XFS_SB_FEAT_INCOMPAT_FTYPE	(1 << 0)	/* filetype in dirent */
 #define XFS_SB_FEAT_INCOMPAT_ALL 0
+
 #define XFS_SB_FEAT_INCOMPAT_UNKNOWN	~XFS_SB_FEAT_INCOMPAT_ALL
 static inline bool
 xfs_sb_has_incompat_feature(
@@ -619,16 +615,30 @@ xfs_sb_has_incompat_log_feature(
 	return (sbp->sb_features_log_incompat & feature) != 0;
 }
 
-static inline bool
-xfs_is_quota_inode(struct xfs_sb *sbp, xfs_ino_t ino)
+/*
+ * V5 superblock specific feature checks
+ */
+static inline int xfs_sb_version_hascrc(xfs_sb_t *sbp)
 {
-	return (ino == sbp->sb_uquotino || ino == sbp->sb_gquotino);
+	return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5;
+}
+
+static inline int xfs_sb_version_hasftype(struct xfs_sb *sbp)
+{
+	return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5 &&
+		xfs_sb_has_incompat_feature(sbp, XFS_SB_FEAT_INCOMPAT_FTYPE);
 }
 
 /*
  * end of superblock version macros
  */
 
+static inline bool
+xfs_is_quota_inode(struct xfs_sb *sbp, xfs_ino_t ino)
+{
+	return (ino == sbp->sb_uquotino || ino == sbp->sb_gquotino);
+}
+
 #define XFS_SB_DADDR		((xfs_daddr_t)0) /* daddr in filesystem/ag */
 #define	XFS_SB_BLOCK(mp)	XFS_HDR_BLOCK(mp, XFS_SB_DADDR)
 #define XFS_BUF_TO_SBP(bp)	((xfs_dsb_t *)((bp)->b_addr))
fs/xfs/xfs_types.h +1 -0
index ce44b18..82bbc34 100644
@@ -140,6 +140,7 @@ typedef enum {
 struct xfs_name {
 	const unsigned char	*name;
 	int			len;
+	int			type;
 };
 
 /*
Signature · 6 lines
1.8.3.2

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

Re: [PATCH 48/49] xfs: Add read-only support for dirent filetype field

Quoted 36 lines · Dave Chinner

From: Dave Chinner<[email protected]>

Add support for the file type field in directory entries so that readdir can return the type of the inode the dirent points to to userspace without first having to read the inode off disk.

The encoding of the type field is a single byte that is added to the end of the directory entry name length. For all intents and purposes, it appends a "hidden" byte to the name field which contains the type information. As the directory entry is already of dynamic size, helpers are already required to access and decode the direct entry structures.

Hence the relevent extraction and iteration helpers are updated to understand the hidden byte. Helpers for reading and writing the filetype field from the directory entries are also added. Only the read helpers are used by this patch. It also adds all the code necessary to read the type information out of the dirents on disk.

Further we add the superblock feature bit and helpers to indicate that we understand the on-disk format change. This is not a compatible change - existing kernels cannot read the new format successfully - so an incompatible feature flag is added. We don't yet allow filesystems to mount with this flag yet - that will be added once write support is added.

Finally, the code to take the type from the VFS, convert it to an XFS on-disk type and put it into the xfs_name structures passed around is added, but the directory code does not use this field yet. That will be in the next patch.

---

fs/xfs/xfs_sb.h xfs_sb_has_incompat_log_feature( · line 630

Quoted 5 lines
fs/xfs/xfs_sb.h +4 -0
+static inline int xfs_sb_version_hasftype(struct xfs_sb *sbp)
+{
+	return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5&&
+		xfs_sb_has_incompat_feature(sbp, XFS_SB_FEAT_INCOMPAT_FTYPE);
  }

This feature should support inode version 2 and 3.

--Mark.

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

#128 lore raw

***** SUSPECTED SPAM ***** Re: [PATCH 48/49] xfs: Add read-only support for dirent filetype field

Quoted 36 lines · Mark Tinguely
Quoted 34 lines · Dave Chinner

From: Dave Chinner<[email protected]>

Add support for the file type field in directory entries so that readdir can return the type of the inode the dirent points to to userspace without first having to read the inode off disk.

The encoding of the type field is a single byte that is added to the end of the directory entry name length. For all intents and purposes, it appends a "hidden" byte to the name field which contains the type information. As the directory entry is already of dynamic size, helpers are already required to access and decode the direct entry structures.

Hence the relevent extraction and iteration helpers are updated to understand the hidden byte. Helpers for reading and writing the filetype field from the directory entries are also added. Only the read helpers are used by this patch. It also adds all the code necessary to read the type information out of the dirents on disk.

Further we add the superblock feature bit and helpers to indicate that we understand the on-disk format change. This is not a compatible change - existing kernels cannot read the new format successfully - so an incompatible feature flag is added. We don't yet allow filesystems to mount with this flag yet - that will be added once write support is added.

Finally, the code to take the type from the VFS, convert it to an XFS on-disk type and put it into the xfs_name structures passed around is added, but the directory code does not use this field yet. That will be in the next patch.

---

Quoted 8 lines

fs/xfs/xfs_sb.h xfs_sb_has_incompat_log_feature( · line 630

Quoted 6 lines
fs/xfs/xfs_sb.h +4 -0
+static inline int xfs_sb_version_hasftype(struct xfs_sb *sbp)
+{
+	return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5&&
+		xfs_sb_has_incompat_feature(sbp, XFS_SB_FEAT_INCOMPAT_FTYPE);
 }

This feature should support inode version 2 and 3.

Has nothing to do with the inode version number - it has to do with the directory structure being modified.

We're changing the directory structure for CRCs, and this builds on top of that. It is essentially part of the V3 directory format, and should be treated as such. Suggesting that we retrofit and support a modified v2 directory format is close to insane - instead of only having to test v2 vs v3 directory formats, you're suggesting we support v2 vs v2+dtype vs v3 vs v3+dtype. We simply do not have the resources to adequately test and support such an explosion of filesystem configurations.

We've had this discussion before - new on-disk features go into the v5 superblock format - the v4 superblock format from this point onwards is essentially legacy support from an upstream development perspective. Upstream development is about moving forward as quickly and cleanly as possible - quadrupling the test matrix for every minor on-disk change is simply not something we can sustain, and that's why I'm pushing back *hard* on any suggestion that we shoul dbe supporting new on-disk format changes on both v4 and v5 superblocks formats. v5 is the future and so all new features need to target v5 filesystem formats and ignore the restrictions that v4 filesystem formats might place on them.

That said, there's nothing to stop anyone from backporting such a feature to an older kernel and maintaining it themselves - it's open source software. But the idea that development should be constrained by having to support both old and new formats is wrong - the old v4 format should be considered stable and we need think very hard about changing it at all now, especially as much of the development focus is now shifting to taking advantage of the additions to the v5 format....

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

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

Re: ***** SUSPECTED SPAM ***** Re: [PATCH 48/49] xfs: Add read-only support for dirent filetype field

Quoted 79 lines · Dave Chinner
Quoted 36 lines · Mark Tinguely
Quoted 34 lines · Dave Chinner

From: Dave Chinner<[email protected]>

Add support for the file type field in directory entries so that readdir can return the type of the inode the dirent points to to userspace without first having to read the inode off disk.

The encoding of the type field is a single byte that is added to the end of the directory entry name length. For all intents and purposes, it appends a "hidden" byte to the name field which contains the type information. As the directory entry is already of dynamic size, helpers are already required to access and decode the direct entry structures.

Hence the relevent extraction and iteration helpers are updated to understand the hidden byte. Helpers for reading and writing the filetype field from the directory entries are also added. Only the read helpers are used by this patch. It also adds all the code necessary to read the type information out of the dirents on disk.

Further we add the superblock feature bit and helpers to indicate that we understand the on-disk format change. This is not a compatible change - existing kernels cannot read the new format successfully - so an incompatible feature flag is added. We don't yet allow filesystems to mount with this flag yet - that will be added once write support is added.

Finally, the code to take the type from the VFS, convert it to an XFS on-disk type and put it into the xfs_name structures passed around is added, but the directory code does not use this field yet. That will be in the next patch.

---

Quoted 8 lines

fs/xfs/xfs_sb.h xfs_sb_has_incompat_log_feature( · line 630

Quoted 6 lines
fs/xfs/xfs_sb.h +4 -0
+static inline int xfs_sb_version_hasftype(struct xfs_sb *sbp)
+{
+	return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5&&
+		xfs_sb_has_incompat_feature(sbp, XFS_SB_FEAT_INCOMPAT_FTYPE);
  }

This feature should support inode version 2 and 3.

Has nothing to do with the inode version number - it has to do with the directory structure being modified.

We're changing the directory structure for CRCs, and this builds on top of that. It is essentially part of the V3 directory format, and should be treated as such. Suggesting that we retrofit and support a modified v2 directory format is close to insane - instead of only having to test v2 vs v3 directory formats, you're suggesting we support v2 vs v2+dtype vs v3 vs v3+dtype. We simply do not have the resources to adequately test and support such an explosion of filesystem configurations.

We've had this discussion before - new on-disk features go into the v5 superblock format - the v4 superblock format from this point onwards is essentially legacy support from an upstream development perspective. Upstream development is about moving forward as quickly and cleanly as possible - quadrupling the test matrix for every minor on-disk change is simply not something we can sustain, and that's why I'm pushing back *hard* on any suggestion that we shoul dbe supporting new on-disk format changes on both v4 and v5 superblocks formats. v5 is the future and so all new features need to target v5 filesystem formats and ignore the restrictions that v4 filesystem formats might place on them.

That said, there's nothing to stop anyone from backporting such a feature to an older kernel and maintaining it themselves - it's open source software. But the idea that development should be constrained by having to support both old and new formats is wrong - the old v4 format should be considered stable and we need think very hard about changing it at all now, especially as much of the development focus is now shifting to taking advantage of the additions to the v5 format....

Quoted 3 lines

Cheers,

Dave.

I guess we need more time to argue this out. It is not going into Linux 3.12 as a crc feature only.

--Mark.

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

#130 lore raw

Re: ***** SUSPECTED SPAM ***** Re: [PATCH 48/49] xfs: Add read-only support for dirent filetype field

Quoted 80 lines · Mark Tinguely
Quoted 79 lines · Dave Chinner
Quoted 36 lines · Mark Tinguely
Quoted 34 lines · Dave Chinner

From: Dave Chinner<[email protected]>

Add support for the file type field in directory entries so that readdir can return the type of the inode the dirent points to to userspace without first having to read the inode off disk.

The encoding of the type field is a single byte that is added to the end of the directory entry name length. For all intents and purposes, it appends a "hidden" byte to the name field which contains the type information. As the directory entry is already of dynamic size, helpers are already required to access and decode the direct entry structures.

Hence the relevent extraction and iteration helpers are updated to understand the hidden byte. Helpers for reading and writing the filetype field from the directory entries are also added. Only the read helpers are used by this patch. It also adds all the code necessary to read the type information out of the dirents on disk.

Further we add the superblock feature bit and helpers to indicate that we understand the on-disk format change. This is not a compatible change - existing kernels cannot read the new format successfully - so an incompatible feature flag is added. We don't yet allow filesystems to mount with this flag yet - that will be added once write support is added.

Finally, the code to take the type from the VFS, convert it to an XFS on-disk type and put it into the xfs_name structures passed around is added, but the directory code does not use this field yet. That will be in the next patch.

---

Quoted 8 lines

fs/xfs/xfs_sb.h xfs_sb_has_incompat_log_feature( · line 630

Quoted 6 lines
fs/xfs/xfs_sb.h +4 -0
+static inline int xfs_sb_version_hasftype(struct xfs_sb *sbp)
+{
+	return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5&&
+		xfs_sb_has_incompat_feature(sbp, XFS_SB_FEAT_INCOMPAT_FTYPE);
 }

This feature should support inode version 2 and 3.

Has nothing to do with the inode version number - it has to do with the directory structure being modified.

We're changing the directory structure for CRCs, and this builds on top of that. It is essentially part of the V3 directory format, and should be treated as such. Suggesting that we retrofit and support a modified v2 directory format is close to insane - instead of only having to test v2 vs v3 directory formats, you're suggesting we support v2 vs v2+dtype vs v3 vs v3+dtype. We simply do not have the resources to adequately test and support such an explosion of filesystem configurations.

We've had this discussion before - new on-disk features go into the v5 superblock format - the v4 superblock format from this point onwards is essentially legacy support from an upstream development perspective. Upstream development is about moving forward as quickly and cleanly as possible - quadrupling the test matrix for every minor on-disk change is simply not something we can sustain, and that's why I'm pushing back *hard* on any suggestion that we shoul dbe supporting new on-disk format changes on both v4 and v5 superblocks formats. v5 is the future and so all new features need to target v5 filesystem formats and ignore the restrictions that v4 filesystem formats might place on them.

That said, there's nothing to stop anyone from backporting such a feature to an older kernel and maintaining it themselves - it's open source software. But the idea that development should be constrained by having to support both old and new formats is wrong - the old v4 format should be considered stable and we need think very hard about changing it at all now, especially as much of the development focus is now shifting to taking advantage of the additions to the v5 format....

Quoted 6 lines
Quoted 3 lines

Cheers,

Dave.

I guess we need more time to argue this out. It is not going into Linux 3.12 as a crc feature only.

Seriously?

This was *always* intended as a feature that went along with the v3 directory modifications. For example, see slide 40 of this presentation:

http://xfs.org/images/d/d1/Xfs-scalability-lca2012.pdf

the d_type field is listed alongside version counters, inode create times, and unlinked list logging via inode items....

The only reason this has been done as a feature bit is because I didn't have it done in time to included it under the v5 superblock version change.

The directory format for v4 filesystems is not going to change. We do not have the resources to test it adequately, nor do we have the resources to support it adequately. We're already taking on a huge amount of risk with the v5 superblock changes, and our fallback position is that v4 superblock formats are unchanged and so unaffected by the format changes made for v5. Pushing format changes intended only for v5 fielsystems back into v4 filesystems jeopodises that fallback position and exposes all existing filesystems to increased risk.

And that is a risk I'm not willing to take on behalf of upstream kernel users. Those that move to CRC enabled filesystems know the risks of being early adopters and accept that there may be problems encountered. THose that are using v4 filesystems expect that there are no risky, destabilising changes made to the on-disk format, yet that's exactly what you are suggesting we do.

I'll repeat again what I've said all along - new on-disk format changes for upstream kernels need to be done on v5 filesystems as the v4 format is now considered stable and in maintenance mode. It takes months to to test and stabilise format changes and such changes do not align to the goals of maintaining a stable code base.

This is the same situationas when SGI changed from v3 superblocks to v4 superblocks back in the Irix 6.1/6.2 days. All new features targetted v4 superblocks, as the release process would result in all platforms shipping with v4 superblocks for all new filesystems with the next release a year later (6.5).

This is exactly the same situation - upstream development is solely focussed on future releases, and as such needs to make decisions based on what is best for us in the medium to long term. The v4 superblocks have lasted for 15 years, but we are now at a similar line in the sand - we have a major format and focus shift with v5 superblocks and that's where we need to be focussing our development direction and decisions.

Looking backwards by requiring new features to be chained to the old format is a bad direction to be taking - it compromises what we can do in the long term based on those features, and in the short term requires more resources to develop and test the new features. It's simply the wrong direction to be taking for upstream development.

This is why I'm pushing back hard on any suggestions that we target new features on v4 superblocks - it's a development dead end and therefore essentially a waste of upstream development resources....

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

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

Re: ***** SUSPECTED SPAM ***** Re: [PATCH 48/49] xfs: Add read-only support for dirent filetype field

Quoted 81 lines · Dave Chinner
Quoted 80 lines · Mark Tinguely
Quoted 79 lines · Dave Chinner
Quoted 36 lines · Mark Tinguely
Quoted 34 lines · Dave Chinner

From: Dave Chinner<[email protected]>

Add support for the file type field in directory entries so that readdir can return the type of the inode the dirent points to to userspace without first having to read the inode off disk.

The encoding of the type field is a single byte that is added to the end of the directory entry name length. For all intents and purposes, it appends a "hidden" byte to the name field which contains the type information. As the directory entry is already of dynamic size, helpers are already required to access and decode the direct entry structures.

Hence the relevent extraction and iteration helpers are updated to understand the hidden byte. Helpers for reading and writing the filetype field from the directory entries are also added. Only the read helpers are used by this patch. It also adds all the code necessary to read the type information out of the dirents on disk.

Further we add the superblock feature bit and helpers to indicate that we understand the on-disk format change. This is not a compatible change - existing kernels cannot read the new format successfully - so an incompatible feature flag is added. We don't yet allow filesystems to mount with this flag yet - that will be added once write support is added.

Finally, the code to take the type from the VFS, convert it to an XFS on-disk type and put it into the xfs_name structures passed around is added, but the directory code does not use this field yet. That will be in the next patch.

---

Quoted 8 lines

fs/xfs/xfs_sb.h xfs_sb_has_incompat_log_feature( · line 630

Quoted 6 lines
fs/xfs/xfs_sb.h +4 -0
+static inline int xfs_sb_version_hasftype(struct xfs_sb *sbp)
+{
+	return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5&&
+		xfs_sb_has_incompat_feature(sbp, XFS_SB_FEAT_INCOMPAT_FTYPE);
  }

This feature should support inode version 2 and 3.

Has nothing to do with the inode version number - it has to do with the directory structure being modified.

We're changing the directory structure for CRCs, and this builds on top of that. It is essentially part of the V3 directory format, and should be treated as such. Suggesting that we retrofit and support a modified v2 directory format is close to insane - instead of only having to test v2 vs v3 directory formats, you're suggesting we support v2 vs v2+dtype vs v3 vs v3+dtype. We simply do not have the resources to adequately test and support such an explosion of filesystem configurations.

We've had this discussion before - new on-disk features go into the v5 superblock format - the v4 superblock format from this point onwards is essentially legacy support from an upstream development perspective. Upstream development is about moving forward as quickly and cleanly as possible - quadrupling the test matrix for every minor on-disk change is simply not something we can sustain, and that's why I'm pushing back *hard* on any suggestion that we shoul dbe supporting new on-disk format changes on both v4 and v5 superblocks formats. v5 is the future and so all new features need to target v5 filesystem formats and ignore the restrictions that v4 filesystem formats might place on them.

That said, there's nothing to stop anyone from backporting such a feature to an older kernel and maintaining it themselves - it's open source software. But the idea that development should be constrained by having to support both old and new formats is wrong - the old v4 format should be considered stable and we need think very hard about changing it at all now, especially as much of the development focus is now shifting to taking advantage of the additions to the v5 format....

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Cheers,

Dave.

I guess we need more time to argue this out. It is not going into Linux 3.12 as a crc feature only.

Seriously?

yes seriously.

Quoted 57 lines

This was *always* intended as a feature that went along with the v3 directory modifications. For example, see slide 40 of this presentation:

http://xfs.org/images/d/d1/Xfs-scalability-lca2012.pdf

the d_type field is listed alongside version counters, inode create times, and unlinked list logging via inode items....

The only reason this has been done as a feature bit is because I didn't have it done in time to included it under the v5 superblock version change.

The directory format for v4 filesystems is not going to change. We do not have the resources to test it adequately, nor do we have the resources to support it adequately. We're already taking on a huge amount of risk with the v5 superblock changes, and our fallback position is that v4 superblock formats are unchanged and so unaffected by the format changes made for v5. Pushing format changes intended only for v5 fielsystems back into v4 filesystems jeopodises that fallback position and exposes all existing filesystems to increased risk.

And that is a risk I'm not willing to take on behalf of upstream kernel users. Those that move to CRC enabled filesystems know the risks of being early adopters and accept that there may be problems encountered. THose that are using v4 filesystems expect that there are no risky, destabilising changes made to the on-disk format, yet that's exactly what you are suggesting we do.

I'll repeat again what I've said all along - new on-disk format changes for upstream kernels need to be done on v5 filesystems as the v4 format is now considered stable and in maintenance mode. It takes months to to test and stabilise format changes and such changes do not align to the goals of maintaining a stable code base.

This is the same situationas when SGI changed from v3 superblocks to v4 superblocks back in the Irix 6.1/6.2 days. All new features targetted v4 superblocks, as the release process would result in all platforms shipping with v4 superblocks for all new filesystems with the next release a year later (6.5).

This is exactly the same situation - upstream development is solely focussed on future releases, and as such needs to make decisions based on what is best for us in the medium to long term. The v4 superblocks have lasted for 15 years, but we are now at a similar line in the sand - we have a major format and focus shift with v5 superblocks and that's where we need to be focussing our development direction and decisions.

Looking backwards by requiring new features to be chained to the old format is a bad direction to be taking - it compromises what we can do in the long term based on those features, and in the short term requires more resources to develop and test the new features. It's simply the wrong direction to be taking for upstream development.

Quoted 3 lines

This is why I'm pushing back hard on any suggestions that we target new features on v4 superblocks - it's a development dead end and therefore essentially a waste of upstream development resources....

v4 is hardly dead end. Feature bits can keep the filesystem stable.

v5 superblock is experimental and is not the automatically the default and only version.

Geoffrey has been expressing concerns about v5 and I agree with them. We came to the party too late, and despite our concerns, SGI has worked hard to get the crc pieces reviewed, tested and committed. The concerns are still there.

Yes, I am serious. v4 is not dead and should get new features where appropriate.

--Mark.

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

#132 lore raw

Re: ***** SUSPECTED SPAM ***** Re: [PATCH 48/49] xfs: Add read-only support for dirent filetype field

Quoted 5 lines · Mark Tinguely

v4 is hardly dead end. Feature bits can keep the filesystem stable.

v5 superblock is experimental and is not the automatically the default and only version.

Quoted 7 lines

Geoffrey has been expressing concerns about v5 and I agree with them. We came to the party too late, and despite our concerns, SGI has worked hard to get the crc pieces reviewed, tested and committed. The concerns are still there.

Yes, I am serious. v4 is not dead and should get new features where appropriate.

It really doesn't make any sense to shoe-horn incompatible on-disk features into the old format, with all the required work, and especially the exploding feature matrix.

That beeing said I'd have no problem with SGI adding this support if they absolutely required it as long as long as not putting the burden on anyone else.

Trying to reject a new feature because it doen't support the legacy disk format is just sad and will not pass the test of time.

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

#133 lore raw

Re: ***** SUSPECTED SPAM ***** Re: [PATCH 48/49] xfs: Add read-only support for dirent filetype field

In reply to Mark Tinguely
Quoted 10 lines · Mark Tinguely
Quoted 9 lines · Dave Chinner
Quoted 8 lines · Mark Tinguely
Quoted 7 lines · Dave Chinner
Quoted 6 lines · Mark Tinguely
Quoted 5 lines · Dave Chinner

From: Dave Chinner<[email protected]>

Add support for the file type field in directory entries so that readdir can return the type of the inode the dirent points to to userspace without first having to read the inode off disk.

.....

Quoted 29 lines
Quoted 29 lines
Quoted 29 lines
Quoted 29 lines
Quoted 4 lines
Quoted 3 lines

---

Quoted 8 lines

fs/xfs/xfs_sb.h xfs_sb_has_incompat_log_feature( · line 630

Quoted 6 lines
fs/xfs/xfs_sb.h +4 -0
+static inline int xfs_sb_version_hasftype(struct xfs_sb *sbp)
+{
+	return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5&&
+		xfs_sb_has_incompat_feature(sbp, XFS_SB_FEAT_INCOMPAT_FTYPE);
 }

This feature should support inode version 2 and 3.

Has nothing to do with the inode version number - it has to do with the directory structure being modified.

We're changing the directory structure for CRCs, and this builds on top of that. It is essentially part of the V3 directory format, and should be treated as such. Suggesting that we retrofit and support a modified v2 directory format is close to insane - instead of only having to test v2 vs v3 directory formats, you're suggesting we support v2 vs v2+dtype vs v3 vs v3+dtype. We simply do not have the resources to adequately test and support such an explosion of filesystem configurations.

We've had this discussion before - new on-disk features go into the v5 superblock format - the v4 superblock format from this point onwards is essentially legacy support from an upstream development perspective.

....

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines

That said, there's nothing to stop anyone from backporting such a feature to an older kernel and maintaining it themselves - it's open source software. But the idea that development should be constrained by having to support both old and new formats is wrong - the old v4 format should be considered stable and we need think very hard about changing it at all now, especially as much of the development focus is now shifting to taking advantage of the additions to the v5 format....

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

I guess we need more time to argue this out. It is not going into Linux 3.12 as a crc feature only.

Seriously?

yes seriously.

Great, another random roadblock from the XFS maintainers to deal with.

Mark, this is not a question of how complex the code is to implement it, it's a question of testing and support. I simply do not have the resources available to me to adequately test on-disk format changes to both v4 and v5 format filesystems. I do not require the functionality on v4 format filesystems, nor do I have the time to support users that will make use of such functionality on v4 filesystems. Let it stabilise in v5 filesystems first, then we can backport it in 6-12 months time.

Quoted 29 lines
Quoted 29 lines

This was *always* intended as a feature that went along with the v3 directory modifications. For example, see slide 40 of this presentation:

http://xfs.org/images/d/d1/Xfs-scalability-lca2012.pdf

the d_type field is listed alongside version counters, inode create times, and unlinked list logging via inode items....

The only reason this has been done as a feature bit is because I didn't have it done in time to included it under the v5 superblock version change.

The directory format for v4 filesystems is not going to change. We do not have the resources to test it adequately, nor do we have the resources to support it adequately. We're already taking on a huge amount of risk with the v5 superblock changes, and our fallback position is that v4 superblock formats are unchanged and so unaffected by the format changes made for v5. Pushing format changes intended only for v5 fielsystems back into v4 filesystems jeopodises that fallback position and exposes all existing filesystems to increased risk.

And that is a risk I'm not willing to take on behalf of upstream kernel users. Those that move to CRC enabled filesystems know the risks of being early adopters and accept that there may be problems encountered. THose that are using v4 filesystems expect that there are no risky, destabilising changes made to the on-disk format, yet that's exactly what you are suggesting we do.

....

Quoted 5 lines
Quoted 3 lines

This is why I'm pushing back hard on any suggestions that we target new features on v4 superblocks - it's a development dead end and therefore essentially a waste of upstream development resources....

v4 is hardly dead end. Feature bits can keep the filesystem stable.

Features bits don't keep a filesystem stable. Adequate testing and enough resources to support users is what keeps the filesystem stable. I don't scale to supporting an exponential feature matrix. I'm providing features appropriate to what I can support. If SGI needs this feature on v4 superblocks *right now*, then they are welcome to write the patch and supply the testing and community level support necessary. I'd appreciate some help writing the userspace code needed to support it properly...

Quoted 2 lines

v5 superblock is experimental and is not the automatically the default and only version.

Sure, but you are saying that the only way to get a brand new experimental feature into the experimental on-disk format is to also provide, test and support that experimental format change in the stable format?

What happened to the ultimatum I was given for getting CRC support into the kernel? i.e "thou shalt not regress existing filesystems with code to support new on disk formats". I mean, that's the rule you guys laid down for the 3.10 CRC merge and other work. it's the rule I've been working to for the past year or so while developing all this stuff.

Why has the story has changed now that we're starting to roll out all sorts of interesting performance improvements based on new on-disk formats? Somebody doesn't want the CRC features because they are "overhead" and "bloat", but they want performance features because "faster is better"?

Sheesh!

Quoted 4 lines

Geoffrey has been expressing concerns about v5 and I agree with them. We came to the party too late, and despite our concerns, SGI has worked hard to get the crc pieces reviewed, tested and committed. The concerns are still there.

I've addressed all of Geoffrey's stated concerns more than once. If he's got any new ones, then I'm more than willing to discuss them with him. For better or for worse, v5 filesystems are here to stay so but please stop using nebulous "concerns" as a reason for stopping us from making forwards progress.

Quoted 2 lines

Yes, I am serious. v4 is not dead and should get new features where appropriate.

And it's not appropriate right now. In 6 months to a year - once we've stabilised the feature on v5 superblocks and have robust userspace tool support - we can add the 5 lines of code to support the feature bit on v4 superblocks. But right now it's asking way too much.

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

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

Re: [PATCH 48/49] xfs: Add read-only support for dirent filetype field

On Wed, Aug 14, 2013 at 05:50:42PM +1000, Dave Chinner wrote:

| On Tue, Aug 13, 2013 at 10:42:32AM -0500, Mark Tinguely wrote:
| > On 08/12/13 19:50, Dave Chinner wrote:
| > >On Mon, Aug 12, 2013 at 08:25:23AM -0500, Mark Tinguely wrote:
| > >>On 08/11/13 19:59, Dave Chinner wrote:
| > >>>On Tue, Jul 30, 2013 at 02:10:32PM -0500, Mark Tinguely wrote:
| > >>>>On 07/19/13 01:25, Dave Chinner wrote:
| > >>>>>From: Dave Chinner<[email protected]>
| > >>>>>
| > >>>>>Add support for the file type field in directory entries so that
| > >>>>>readdir can return the type of the inode the dirent points to to
| > >>>>>userspace without first having to read the inode off disk.
| .....
| > >>>>>Signed-off-by: Dave Chinner<[email protected]>
| > >>>>>---
| > >>>>>
| > >>>>
| > >>>>>+static inline int xfs_sb_version_hasftype(struct xfs_sb *sbp)
| > >>>>>+{
| > >>>>>+	return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5&&
| > >>>>>+		xfs_sb_has_incompat_feature(sbp, XFS_SB_FEAT_INCOMPAT_FTYPE);
| > >>>>>  }
| > >>>>>
| > >>>>
| > >>>>This feature should support inode version 2 and 3.
| > >>>
| > >>>Has nothing to do with the inode version number - it has to do with
| > >>>the directory structure being modified.
| > >>>
| > >>>We're changing the directory structure for CRCs, and this builds on
| > >>>top of that. It is essentially part of the V3 directory format, and
| > >>>should be treated as such. Suggesting that we retrofit and support a
| > >>>modified v2 directory format is close to insane - instead of only
| > >>>having to test v2 vs v3 directory formats, you're suggesting we
| > >>>support v2 vs v2+dtype vs v3 vs v3+dtype. We simply do not have the
| > >>>resources to adequately test and support such an explosion of
| > >>>filesystem configurations.
| > >>>
| > >>>We've had this discussion before - new on-disk features go into the
| > >>>v5 superblock format - the v4 superblock format from this point
| > >>>onwards is essentially legacy support from an upstream development
| > >>>perspective.
| ....
| > >>>That said, there's nothing to stop anyone from backporting such a
| > >>>feature to an older kernel and maintaining it themselves - it's open
| > >>>source software. But the idea that development should be constrained
| > >>>by having to support both old and new formats is wrong - the old v4
| > >>>format should be considered stable and we need think very hard about
| > >>>changing it at all now, especially as much of the development focus
| > >>>is now shifting to taking advantage of the additions to the v5
| > >>>format....
| > >>
| > >>I guess we need more time to argue this out. It is not going into
| > >>Linux 3.12 as a crc feature only.
| > >
| > >Seriously?
| > 
| > yes seriously.
| 
| Great, another random roadblock from the XFS maintainers to deal
| with.

The addition of the file type field to directory entries is a great new feature. Your implementation of adding a "hidden" byte to the name field is especially clever. This is a feature that can benefit both dir2 and dir3 format filesystems and is completely independent of your CRC and self describing metadata feature work. I understand that you are not interested in porting the capability to dir2 format filesystems yourself and do not have the resources to provide the associated testing and support. Myself and others within SGI have discussed these issues, and we are willing to take on the work ourselves rather than have this feature go only into v5 superblock filesystems where the feature is only accessible to those who are willing to risk using experimental code. Given that SGI will be doing the work to support the file type field in dir2 format filesystems, it doesn't make sense to add the code to v5 filesystems until all of the work is complete as there could be additional considerations for the on disk changes.

We also noted that this feature should not be added to the kernel until userspace code is available to support this feature. Specifically, xfs_repair needs to validate and if needed repair the the file type field. Also, tests are needed to validate the new functionality. While I expect that you will provide this support for v5 superblock and dir3 filesystems, one of us at SGI will extend the support to v4 superblock and dir2 filesystems.

Signature · 6 lines
Geoffrey Wehrman  651-683-5496  [email protected]

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

Re: [PATCH 48/49] xfs: Add read-only support for dirent filetype field

Quoted 62 lines · Geoffrey Wehrman

On Wed, Aug 14, 2013 at 05:50:42PM +1000, Dave Chinner wrote:

| On Tue, Aug 13, 2013 at 10:42:32AM -0500, Mark Tinguely wrote:
| > On 08/12/13 19:50, Dave Chinner wrote:
| > >On Mon, Aug 12, 2013 at 08:25:23AM -0500, Mark Tinguely wrote:
| > >>On 08/11/13 19:59, Dave Chinner wrote:
| > >>>On Tue, Jul 30, 2013 at 02:10:32PM -0500, Mark Tinguely wrote:
| > >>>>On 07/19/13 01:25, Dave Chinner wrote:
| > >>>>>From: Dave Chinner<[email protected]>
| > >>>>>
| > >>>>>Add support for the file type field in directory entries so that
| > >>>>>readdir can return the type of the inode the dirent points to to
| > >>>>>userspace without first having to read the inode off disk.
| .....
| > >>>>>Signed-off-by: Dave Chinner<[email protected]>
| > >>>>>---
| > >>>>>
| > >>>>
| > >>>>>+static inline int xfs_sb_version_hasftype(struct xfs_sb *sbp)
| > >>>>>+{
| > >>>>>+	return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5&&
| > >>>>>+		xfs_sb_has_incompat_feature(sbp, XFS_SB_FEAT_INCOMPAT_FTYPE);
| > >>>>>  }
| > >>>>>
| > >>>>
| > >>>>This feature should support inode version 2 and 3.
| > >>>
| > >>>Has nothing to do with the inode version number - it has to do with
| > >>>the directory structure being modified.
| > >>>
| > >>>We're changing the directory structure for CRCs, and this builds on
| > >>>top of that. It is essentially part of the V3 directory format, and
| > >>>should be treated as such. Suggesting that we retrofit and support a
| > >>>modified v2 directory format is close to insane - instead of only
| > >>>having to test v2 vs v3 directory formats, you're suggesting we
| > >>>support v2 vs v2+dtype vs v3 vs v3+dtype. We simply do not have the
| > >>>resources to adequately test and support such an explosion of
| > >>>filesystem configurations.
| > >>>
| > >>>We've had this discussion before - new on-disk features go into the
| > >>>v5 superblock format - the v4 superblock format from this point
| > >>>onwards is essentially legacy support from an upstream development
| > >>>perspective.
| ....
| > >>>That said, there's nothing to stop anyone from backporting such a
| > >>>feature to an older kernel and maintaining it themselves - it's open
| > >>>source software. But the idea that development should be constrained
| > >>>by having to support both old and new formats is wrong - the old v4
| > >>>format should be considered stable and we need think very hard about
| > >>>changing it at all now, especially as much of the development focus
| > >>>is now shifting to taking advantage of the additions to the v5
| > >>>format....
| > >>
| > >>I guess we need more time to argue this out. It is not going into
| > >>Linux 3.12 as a crc feature only.
| > >
| > >Seriously?
| > 
| > yes seriously.
| 
| Great, another random roadblock from the XFS maintainers to deal
| with.
Quoted 3 lines

The addition of the file type field to directory entries is a great new feature. Your implementation of adding a "hidden" byte to the name field is especially clever.

Then go thank Christoph for that - I'm pretty sure he came up with the idea one night when we drinking in a bar somewhere a few years ago...

Quoted 6 lines

This is a feature that can benefit both
dir2 and dir3 format filesystems and is completely independent of your CRC and self describing metadata feature work. I understand that you are not interested in porting the capability to dir2 format filesystems yourself and do not have the resources to provide the associated testing and support.

Yes, I've been pretty clear about that.

Quoted 1 line

Myself and others within SGI have discussed these issues,

But not with the community.

So the SGI hivemind decided something behind closed doors, and you're expecting us to just swallow that decision and not question it?

Quoted 3 lines

and we are willing to take on the work ourselves rather than have this feature go only into v5 superblock filesystems where the feature is only accessible to those who are willing to risk using experimental code.

Great. So Ben's going to merge the patches then?

Quoted 4 lines

Given that SGI will be doing the work to support the file type field in dir2 format filesystems, it doesn't make sense to add the code to v5 filesystems until all of the work is complete as there could be additional considerations for the on disk changes.

<groan>

No, you're saying that merging is now dependent on whenever SGI gets around to doing v4 support work?

So, what's the plan of action here? Who is going to do that work? How long is it going to take them? Are we talking about a delay of couple of days, a few weeks, or months?

But let's address the core premise being asserted here by the SGI hivemind - that we can't add a v5 feature until it's also made for v4 filesystems. I've said it time and time again: the v5 format will not be compromised by having to cater for supporting v4 structures. I've been saying this for over 3 years. Indeed, in that presentation at LCA 18 months ago: I said on slide 36:

" * No attempt to provide backwards or forwards
compatibility for format changes.

* Avoids compromising the new on-disk format design"

This still holds true. This directory format change is designed specifically for v5 superblocks formats, and the process you are insisting on is that that we should compromise the format change so that we can support the same feature on v4 filesystems. This is the complete antithesis of the design and architectural principles that have been guiding our work over the past 3 years, and I'm not about to compromise on it now because it's a matter of *principle*.

This should not come as a surprise to anyone at SGI, but we've been open and clear about the processes that we have using to design new features for a quite a long time now. If SGI disagrees with the processes and principles we strive to acheive, then perhaps we need to have a different discussion.....

Quoted 3 lines

We also noted that this feature should not be added to the kernel until userspace code is available to support this feature. Specifically, xfs_repair needs to validate and if needed repair the the file type field.

Sure. I've been waiting for review of the code first so that any nasty problems could be dealt with without having to double handle the code changes in userspace. Instead of review, all I've got from SGI is two weeks of silence and then a "get stuffed until you do v4 support as well" response.

I'll send the patches for repair support on top of that stack tomorrow, and then this is not longer a barrier to merging it. Will you merge it then?

Quoted 1 line

Also, tests are needed to validate the new functionality.

They can be written now that xfs_io readdir support hase been merged. Though I've already done manual tests with the getdents example code from the getdents(2) man page so I know it does actually work correctly...

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

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

Re: [PATCH 48/49] xfs: Add read-only support for dirent filetype field

On Thu, Aug 15, 2013 at 02:22:10PM +1000, Dave Chinner wrote:

| On Wed, Aug 14, 2013 at 01:47:30PM -0500, Geoffrey Wehrman wrote:
| > On Wed, Aug 14, 2013 at 05:50:42PM +1000, Dave Chinner wrote:
| > | On Tue, Aug 13, 2013 at 10:42:32AM -0500, Mark Tinguely wrote:
| > | > On 08/12/13 19:50, Dave Chinner wrote:
| > | > >On Mon, Aug 12, 2013 at 08:25:23AM -0500, Mark Tinguely wrote:
| > | > >>On 08/11/13 19:59, Dave Chinner wrote:
| > | > >>>On Tue, Jul 30, 2013 at 02:10:32PM -0500, Mark Tinguely wrote:
| > | > >>>>On 07/19/13 01:25, Dave Chinner wrote:
| > | > >>>>>From: Dave Chinner<[email protected]>
| > | > >>>>>
| > | > >>>>>Add support for the file type field in directory entries so that
| > | > >>>>>readdir can return the type of the inode the dirent points to to
| > | > >>>>>userspace without first having to read the inode off disk.
| > | .....
| > | > >>>>>Signed-off-by: Dave Chinner<[email protected]>
| > | > >>>>>---
| > | > >>>>>
| > | > >>>>
| > | > >>>>>+static inline int xfs_sb_version_hasftype(struct xfs_sb *sbp)
| > | > >>>>>+{
| > | > >>>>>+	return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5&&
| > | > >>>>>+		xfs_sb_has_incompat_feature(sbp, XFS_SB_FEAT_INCOMPAT_FTYPE);
| > | > >>>>>  }
| > | > >>>>>
| > | > >>>>
| > | > >>>>This feature should support inode version 2 and 3.
| > | > >>>
| > | > >>>Has nothing to do with the inode version number - it has to do with
| > | > >>>the directory structure being modified.
| > | > >>>
| > | > >>>We're changing the directory structure for CRCs, and this builds on
| > | > >>>top of that. It is essentially part of the V3 directory format, and
| > | > >>>should be treated as such. Suggesting that we retrofit and support a
| > | > >>>modified v2 directory format is close to insane - instead of only
| > | > >>>having to test v2 vs v3 directory formats, you're suggesting we
| > | > >>>support v2 vs v2+dtype vs v3 vs v3+dtype. We simply do not have the
| > | > >>>resources to adequately test and support such an explosion of
| > | > >>>filesystem configurations.
| > | > >>>
| > | > >>>We've had this discussion before - new on-disk features go into the
| > | > >>>v5 superblock format - the v4 superblock format from this point
| > | > >>>onwards is essentially legacy support from an upstream development
| > | > >>>perspective.
| > | ....
| > | > >>>That said, there's nothing to stop anyone from backporting such a
| > | > >>>feature to an older kernel and maintaining it themselves - it's open
| > | > >>>source software. But the idea that development should be constrained
| > | > >>>by having to support both old and new formats is wrong - the old v4
| > | > >>>format should be considered stable and we need think very hard about
| > | > >>>changing it at all now, especially as much of the development focus
| > | > >>>is now shifting to taking advantage of the additions to the v5
| > | > >>>format....
| > | > >>
| > | > >>I guess we need more time to argue this out. It is not going into
| > | > >>Linux 3.12 as a crc feature only.
| > | > >
| > | > >Seriously?
| > | > 
| > | > yes seriously.
| > | 
| > | Great, another random roadblock from the XFS maintainers to deal
| > | with.
| > 
| > The addition of the file type field to directory entries is a great
| > new feature.  Your implementation of adding a "hidden" byte to the name
| > field is especially clever.
| 
| Then go thank Christoph for that - I'm pretty sure he came up with
| the idea one night when we drinking in a bar somewhere a few years
| ago...
| 
| > This is a feature that can benefit both
| > dir2 and dir3 format filesystems and is completely independent of your
| > CRC and self describing metadata feature work.  I understand that you
| > are not interested in porting the capability to dir2 format filesystems
| > yourself and do not have the resources to provide the associated testing
| > and support.
| 
| Yes, I've been pretty clear about that.
| 
| > Myself and others within SGI have discussed these issues,
| 
| But not with the community.

The community discussion is being held here. I'm being open about the discussion we held off-line.

| So the SGI hivemind decided something behind closed doors, and
| you're expecting us to just swallow that decision and not question
| it?

I am not expecting you to swallow anything. I am stating my position on this features and letting the community know that there are others in the community who concur. Mark, Ben, Rich, and Troy were all part of this groups. We are all members of the XFS community and are participating in the community discussion.

| > and we are willing to take on the work ourselves rather than have this
| > feature go only into v5 superblock filesystems where the feature is only
| > accessible to those who are willing to risk using experimental code.
| 
| Great. So Ben's going to merge the patches then?
| 
| > Given that SGI will be doing the work to support the file type field
| > in dir2 format filesystems, it doesn't make sense to add the code to
| > v5 filesystems until all of the work is complete as there could be
| > additional considerations for the on disk changes.
| 
| <groan>
| 
| No, you're saying that merging is now dependent on whenever SGI gets
| around to doing v4 support work?
| 
| So, what's the plan of action here?  Who is going to do that work?
| How long is it going to take them? Are we talking about a delay of
| couple of days, a few weeks, or months?

Mark has volunteered to do the work, and is committed to having it ready for the 3.13 merge window.

| But let's address the core premise being asserted here by the SGI
| hivemind - that we can't add a v5 feature until it's also made for
| v4 filesystems.  I've said it time and time again: the v5 format
| will not be compromised by having to cater for supporting v4
| structures. I've been saying this for over 3 years. Indeed, in that
| presentation at LCA 18 months ago: I said on slide 36:
| 
| " * No attempt to provide backwards or forwards
|     compatibility for format changes.
| 
| 	* Avoids compromising the new on-disk format design"
| 
| This still holds true. This directory format change is designed
| specifically for v5 superblocks formats, and the process you are
| insisting on is that that we should compromise the format change so
| that we can support the same feature on v4 filesystems.  This is the
| complete antithesis of the design and architectural principles that
| have been guiding our work over the past 3 years, and I'm not about
| to compromise on it now because it's a matter of *principle*.
| 
| This should not come as a surprise to anyone at SGI, but we've been
| open and clear about the processes that we have using to design new
| features for a quite a long time now. If SGI disagrees with the
| processes and principles we strive to acheive, then perhaps we need
| to have a different discussion.....

I'm not asking for any compromise in the on-disk format change. My wording wasn't the best. It was not the on-disk format change that may be affected. Rather it is the code to support the on-disk format change that will likely be affected. I'm not asking you to make any changes to your code at this time or to provide backward compatibility code. Mark will provide the code which support both v4 and v5 superblock filesystems. I do expect that you will not object to Mark's code under the principle of not allowing any features to be added to v4 superblock filesystems.

| > We also noted that this feature should not be added to the kernel until
| > userspace code is available to support this feature.  Specifically,
| > xfs_repair needs to validate and if needed repair the the file type field.
| 
| Sure. I've been waiting for review of the code first so that any
| nasty problems could be dealt with without having to double handle
| the code changes in userspace. Instead of review, all I've got from
| SGI is two weeks of silence and then a "get stuffed until you do v4
| support as well" response.
| 
| I'll send the patches for repair support on top of that stack
| tomorrow, and then this is not longer a barrier to merging it. Will
| you merge it then?
| 
| > Also, tests are needed to validate the new functionality.
| 
| They can be written now that xfs_io readdir support hase been
| merged. Though I've already done manual tests with the getdents
| example code from the getdents(2) man page so I know it does
| actually work correctly...

When the repair support is ready, xfs_db support is ready, and tests are ready, then there will be no objection to merging the feature. I realize that I have not mentioned xfs_db support earlier, but that is another important capability which needs to be included with this feature.

Signature · 6 lines
Geoffrey Wehrman  651-683-5496  [email protected]

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

Re: [PATCH 48/49] xfs: Add read-only support for dirent filetype field

In reply to Geoffrey Wehrman
Quoted 78 lines · Geoffrey Wehrman

On Wed, Aug 14, 2013 at 05:50:42PM +1000, Dave Chinner wrote:

| On Tue, Aug 13, 2013 at 10:42:32AM -0500, Mark Tinguely wrote:
| > On 08/12/13 19:50, Dave Chinner wrote:
| > >On Mon, Aug 12, 2013 at 08:25:23AM -0500, Mark Tinguely wrote:
| > >>On 08/11/13 19:59, Dave Chinner wrote:
| > >>>On Tue, Jul 30, 2013 at 02:10:32PM -0500, Mark Tinguely wrote:
| > >>>>On 07/19/13 01:25, Dave Chinner wrote:
| > >>>>>From: Dave Chinner<[email protected]>
| > >>>>>
| > >>>>>Add support for the file type field in directory entries so that
| > >>>>>readdir can return the type of the inode the dirent points to to
| > >>>>>userspace without first having to read the inode off disk.
| .....
| > >>>>>Signed-off-by: Dave Chinner<[email protected]>
| > >>>>>---
| > >>>>>
| > >>>>
| > >>>>>+static inline int xfs_sb_version_hasftype(struct xfs_sb *sbp)
| > >>>>>+{
| > >>>>>+	return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5&&
| > >>>>>+		xfs_sb_has_incompat_feature(sbp, XFS_SB_FEAT_INCOMPAT_FTYPE);
| > >>>>>  }
| > >>>>>
| > >>>>
| > >>>>This feature should support inode version 2 and 3.
| > >>>
| > >>>Has nothing to do with the inode version number - it has to do with
| > >>>the directory structure being modified.
| > >>>
| > >>>We're changing the directory structure for CRCs, and this builds on
| > >>>top of that. It is essentially part of the V3 directory format, and
| > >>>should be treated as such. Suggesting that we retrofit and support a
| > >>>modified v2 directory format is close to insane - instead of only
| > >>>having to test v2 vs v3 directory formats, you're suggesting we
| > >>>support v2 vs v2+dtype vs v3 vs v3+dtype. We simply do not have the
| > >>>resources to adequately test and support such an explosion of
| > >>>filesystem configurations.
| > >>>
| > >>>We've had this discussion before - new on-disk features go into the
| > >>>v5 superblock format - the v4 superblock format from this point
| > >>>onwards is essentially legacy support from an upstream development
| > >>>perspective.
| ....
| > >>>That said, there's nothing to stop anyone from backporting such a
| > >>>feature to an older kernel and maintaining it themselves - it's open
| > >>>source software. But the idea that development should be constrained
| > >>>by having to support both old and new formats is wrong - the old v4
| > >>>format should be considered stable and we need think very hard about
| > >>>changing it at all now, especially as much of the development focus
| > >>>is now shifting to taking advantage of the additions to the v5
| > >>>format....
| > >>
| > >>I guess we need more time to argue this out. It is not going into
| > >>Linux 3.12 as a crc feature only.
| > >
| > >Seriously?
| >
| > yes seriously.
|
| Great, another random roadblock from the XFS maintainers to deal
| with.

The addition of the file type field to directory entries is a great new feature. Your implementation of adding a "hidden" byte to the name field is especially clever. This is a feature that can benefit both dir2 and dir3 format filesystems and is completely independent of your CRC and self describing metadata feature work. I understand that you are not interested in porting the capability to dir2 format filesystems yourself and do not have the resources to provide the associated testing and support. Myself and others within SGI have discussed these issues, and we are willing to take on the work ourselves rather than have this feature go only into v5 superblock filesystems where the feature is only accessible to those who are willing to risk using experimental code. Given that SGI will be doing the work to support the file type field in dir2 format filesystems, it doesn't make sense to add the code to v5 filesystems until all of the work is complete as there could be additional considerations for the on disk changes.

Quoted 7 lines

We also noted that this feature should not be added to the kernel until userspace code is available to support this feature. Specifically, xfs_repair needs to validate and if needed repair the the file type field. Also, tests are needed to validate the new functionality. While I expect that you will provide this support for v5 superblock and dir3 filesystems, one of us at SGI will extend the support to v4 superblock and dir2 filesystems.

Hi Geoffrey,

As much as the community admires your brave willingness to protect us from code that was entirely developed by Dave, that is not really how the upstream kernel works.

Dave is pretty much without equal in moving XFS along these days and this is a key feature that we are depending on.

Please don't try to create hurdles to other people getting work into upstream, that kind of thing will lead to a fork of the XFS code base and ultimately that will be harder for all of us.

It sounds like what you really should look at doing is to work inside of SGI to create a private, internal branch of the upstream code that you deliver in your product. Upstream code is all about innovation and new features, we don't let vendor specific, non-upstream branches become the place for hardening our code.

Best regards,

Ric

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

#138 lore raw

Re: [PATCH 48/49] xfs: Add read-only support for dirent filetype field

On Thu, Aug 15, 2013 at 06:59:21AM +0100, Ric Wheeler wrote:

| 
| As much as the community admires your brave willingness to protect us from 
| code that was entirely developed by Dave, that is not really how the 
| upstream kernel works.
| 
| Dave is pretty much without equal in moving XFS along these days and this 
| is a key feature that we are depending on.
| 
| Please don't try to create hurdles to other people getting work into 
| upstream, that kind of thing will lead to a fork of the XFS code base and 
| ultimately that will be harder for all of us.
| 
| It sounds like what you really should look at doing is to work inside of 
| SGI to create a private, internal branch of the upstream code that you 
| deliver in your product. Upstream code is all about innovation and new 
| features, we don't let vendor specific, non-upstream branches become the 
| place for hardening our code.

I agree Dave is a gifted, dedicated, passionate and prolific contributor to the XFS community. His contributions are greatly appreciated as are the contributions of all other members of the XFS community. Dave does stand out as the most significant code contributor to the project. He has played a significant role moving XFS forward both from within SGI and from outside SGI. This does not place his contributions beyond review or discussion however.

My objection to the current readdir filetype field feature code is that the feature is not being made available to mainstream XFS users, only to those willing to run experimental code. Dave has clearly stated that he will not do the back-porting work. I am not expecting Dave to do the back-porting work. Mark has volunteered to fill the back-porting role. Th porting work cannot be completed as the feature is not yet complete. The associated user space code changes have not been submitted, and tests to validate the new feature have not been submitted. I do not consider this to be an unreasonable request, even if there were back-porting required.

If Red Hat is depending on the readdir filetype field feature from Dave and do not wish to wait for the feature to be completed before pulling in the code, then perhaps Red Hat should create a internal branch of the upstream code that you can deliver in your products. The upstream code should be stable and fully functional, not a place for incomplete, partially tested, half finished work.

Signature · 6 lines
Geoffrey Wehrman  651-683-5496  [email protected]

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

Re: [PATCH 48/49] xfs: Add read-only support for dirent filetype field

Quoted 38 lines · Geoffrey Wehrman

On Thu, Aug 15, 2013 at 06:59:21AM +0100, Ric Wheeler wrote:

|
| As much as the community admires your brave willingness to protect us from
| code that was entirely developed by Dave, that is not really how the
| upstream kernel works.
|
| Dave is pretty much without equal in moving XFS along these days and this
| is a key feature that we are depending on.
|
| Please don't try to create hurdles to other people getting work into
| upstream, that kind of thing will lead to a fork of the XFS code base and
| ultimately that will be harder for all of us.
|
| It sounds like what you really should look at doing is to work inside of
| SGI to create a private, internal branch of the upstream code that you
| deliver in your product. Upstream code is all about innovation and new
| features, we don't let vendor specific, non-upstream branches become the
| place for hardening our code.

I agree Dave is a gifted, dedicated, passionate and prolific contributor to the XFS community. His contributions are greatly appreciated as are the contributions of all other members of the XFS community. Dave does stand out as the most significant code contributor to the project. He has played a significant role moving XFS forward both from within SGI and from outside SGI. This does not place his contributions beyond review or discussion however.

My objection to the current readdir filetype field feature code is that the feature is not being made available to mainstream XFS users, only to those willing to run experimental code. Dave has clearly stated that he will not do the back-porting work. I am not expecting Dave to do the back-porting work. Mark has volunteered to fill the back-porting role. Th porting work cannot be completed as the feature is not yet complete. The associated user space code changes have not been submitted, and tests to validate the new feature have not been submitted. I do not consider this to be an unreasonable request, even if there were back-porting required.

Quoted 8 lines

If Red Hat is depending on the readdir filetype field feature from Dave and do not wish to wait for the feature to be completed before pulling in the code, then perhaps Red Hat should create a internal branch of the upstream code that you can deliver in your products. The upstream code should be stable and fully functional, not a place for incomplete, partially tested, half finished work.

I think that you are still unclear on what "mainstream" users are.

People who pay for commercial support use vendor branches of the kernel (from us, from SLES, from you, etc).

Upstream users and community distros normally expect to see new features in their kernels.

For what it's worth, Red Hat has been the largest contributor to XFS for quite a while now & XFS will be our RHEL7 default file system.

We don't ship "untested" or "incomplete" code.

Regards,

Ric

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

#140 lore raw

Re: [PATCH 48/49] xfs: Add read-only support for dirent filetype field

On Thu, Aug 15, 2013 at 10:41:47PM +0100, Ric Wheeler wrote:

| On 08/15/2013 07:04 PM, Geoffrey Wehrman wrote:
| >On Thu, Aug 15, 2013 at 06:59:21AM +0100, Ric Wheeler wrote:
| >|
| >| As much as the community admires your brave willingness to protect us 
| >from
| >| code that was entirely developed by Dave, that is not really how the
| >| upstream kernel works.
| >|
| >| Dave is pretty much without equal in moving XFS along these days and this
| >| is a key feature that we are depending on.
| >|
| >| Please don't try to create hurdles to other people getting work into
| >| upstream, that kind of thing will lead to a fork of the XFS code base and
| >| ultimately that will be harder for all of us.
| >|
| >| It sounds like what you really should look at doing is to work inside of
| >| SGI to create a private, internal branch of the upstream code that you
| >| deliver in your product. Upstream code is all about innovation and new
| >| features, we don't let vendor specific, non-upstream branches become the
| >| place for hardening our code.
| >
| >I agree Dave is a gifted, dedicated, passionate and prolific contributor
| >to the XFS community.  His contributions are greatly appreciated as are
| >the contributions of all other members of the XFS community.  Dave does
| >stand out as the most significant code contributor to the project.  He
| >has played a significant role moving XFS forward both from within SGI
| >and from outside SGI.  This does not place his contributions beyond
| >review or discussion however.
| >
| >My objection to the current readdir filetype field feature code is that
| >the feature is not being made available to mainstream XFS users, only
| >to those willing to run experimental code.  Dave has clearly stated that
| >he will not do the back-porting work.  I am not expecting Dave to do the
| >back-porting work.  Mark has volunteered to fill the back-porting role.
| >Th porting work cannot be completed as the feature is not yet complete.
| >The associated user space code changes have not been submitted,
| >and tests to validate the new feature have not been submitted.  I do
| >not consider this to be an unreasonable request, even if there were
| >back-porting required.
| >
| >If Red Hat is depending on the readdir filetype field feature from Dave
| >and do not wish to wait for the feature to be completed before pulling
| >in the code, then perhaps Red Hat should create a internal branch of
| >the upstream code that you can deliver in your products.  The upstream
| >code should be stable and fully functional, not a place for incomplete,
| >partially tested, half finished work.
| >
| >
| 
| I think that you are still unclear on what "mainstream" users are.
| 
| People who pay for commercial support use vendor branches of the kernel 
| (from us, from SLES, from you, etc).
| 
| Upstream users and community distros normally expect to see new features in 
| their kernels.
| 
| For what it's worth, Red Hat has been the largest contributor to XFS for 
| quite a while now & XFS will be our RHEL7 default file system.
| 
| We don't ship "untested" or "incomplete" code.

Clearly we all have the interests of Linux users in mind whether they be those paying for commercial support, developers embedding Linux in other products, or technically savvy end users. Clearly we don't agree all the time on content, time lines, and process. We each have to be willing to engage in a civil conversation and be willing to compromise.

I recognize that I tend to be a silent bystander until there is an issue where I disagree, and only then do I join the conversation. I do not get involved in the general conversations on the list. I have all kinds of excuses, but it comes down to the fact that I just don't make it a high enough priority. Likewise, I don't tell Dave, Christoph, Eric, and others how much I appreciate their contributions when I do not have an issue. That makes me nothing more than a whiner and complainer, and I apologize for as much.

I think it is great that Red Hat has been the largest contributor of XFS code recently. I'm excited that XFS will be the default filesystem for RHEL 7. I am not trying to sabotage any of Red Hat's plans. Success for Red Hat and XFS translates into success for all Linux users.

I would like to take this opportunity to point out that SGI's attempts to contribute code to XFS are frequently blocked by Red Hat without technical merit. Most recently we tried to submit code for the agskip mount option which SGI has been shipping for years. [http://oss.sgi.com/archives/xfs/2013-01/msg00561.html]
We asked for fields to be reserved in the new v3 inodes for parent pointers and allocation policies. That request was soundly rejected despite the existence of unreserved padding in the new inode format.
[http://oss.sgi.com/archives/xfs/2013-04/msg00214.html] The response to code submitted by SGI has been so negative, we don't even bother submitting most of our code to the list anymore as long as it does not affect the on-disk format. The list of features and capabilities that we carry in our internally maintained source trees is significant and long:
DMAPI, behavior chains, agskip mount option, ibound mount option, etc. These are all features that have been rejected by the external community but are of value to SGI customers.

A reiterate my appreciation of Red Hat's contributions to XFS. However, I hope that you and others at Red Hat recognize that Red Hat is not the sole source for innovation and contributions to XFS. The playing field must be kept level and everyone in the community must be allowed to participate.

Geoffrey Wehrman

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

#141 lore raw

Re: [PATCH 48/49] xfs: Add read-only support for dirent filetype field

Quoted 83 lines · Geoffrey Wehrman

On Thu, Aug 15, 2013 at 10:41:47PM +0100, Ric Wheeler wrote:

| On 08/15/2013 07:04 PM, Geoffrey Wehrman wrote:
| >On Thu, Aug 15, 2013 at 06:59:21AM +0100, Ric Wheeler wrote:
| >|
| >| As much as the community admires your brave willingness to protect us 
| >from
| >| code that was entirely developed by Dave, that is not really how the
| >| upstream kernel works.
| >|
| >| Dave is pretty much without equal in moving XFS along these days and this
| >| is a key feature that we are depending on.
| >|
| >| Please don't try to create hurdles to other people getting work into
| >| upstream, that kind of thing will lead to a fork of the XFS code base and
| >| ultimately that will be harder for all of us.
| >|
| >| It sounds like what you really should look at doing is to work inside of
| >| SGI to create a private, internal branch of the upstream code that you
| >| deliver in your product. Upstream code is all about innovation and new
| >| features, we don't let vendor specific, non-upstream branches become the
| >| place for hardening our code.
| >
| >I agree Dave is a gifted, dedicated, passionate and prolific contributor
| >to the XFS community.  His contributions are greatly appreciated as are
| >the contributions of all other members of the XFS community.  Dave does
| >stand out as the most significant code contributor to the project.  He
| >has played a significant role moving XFS forward both from within SGI
| >and from outside SGI.  This does not place his contributions beyond
| >review or discussion however.
| >
| >My objection to the current readdir filetype field feature code is that
| >the feature is not being made available to mainstream XFS users, only
| >to those willing to run experimental code.  Dave has clearly stated that
| >he will not do the back-porting work.  I am not expecting Dave to do the
| >back-porting work.  Mark has volunteered to fill the back-porting role.
| >Th porting work cannot be completed as the feature is not yet complete.
| >The associated user space code changes have not been submitted,
| >and tests to validate the new feature have not been submitted.  I do
| >not consider this to be an unreasonable request, even if there were
| >back-porting required.
| >
| >If Red Hat is depending on the readdir filetype field feature from Dave
| >and do not wish to wait for the feature to be completed before pulling
| >in the code, then perhaps Red Hat should create a internal branch of
| >the upstream code that you can deliver in your products.  The upstream
| >code should be stable and fully functional, not a place for incomplete,
| >partially tested, half finished work.
| >
| >
| 
| I think that you are still unclear on what "mainstream" users are.
| 
| People who pay for commercial support use vendor branches of the kernel 
| (from us, from SLES, from you, etc).
| 
| Upstream users and community distros normally expect to see new features in 
| their kernels.
| 
| For what it's worth, Red Hat has been the largest contributor to XFS for 
| quite a while now & XFS will be our RHEL7 default file system.
| 
| We don't ship "untested" or "incomplete" code.

Clearly we all have the interests of Linux users in mind whether they be those paying for commercial support, developers embedding Linux in other products, or technically savvy end users. Clearly we don't agree all the time on content, time lines, and process. We each have to be willing to engage in a civil conversation and be willing to compromise.

I recognize that I tend to be a silent bystander until there is an issue where I disagree, and only then do I join the conversation. I do not get involved in the general conversations on the list. I have all kinds of excuses, but it comes down to the fact that I just don't make it a high enough priority. Likewise, I don't tell Dave, Christoph, Eric, and others how much I appreciate their contributions when I do not have an issue. That makes me nothing more than a whiner and complainer, and I apologize for as much.

I think it is great that Red Hat has been the largest contributor of XFS code recently. I'm excited that XFS will be the default filesystem for RHEL 7. I am not trying to sabotage any of Red Hat's plans. Success for Red Hat and XFS translates into success for all Linux users.

Quoted 5 lines

I would like to take this opportunity to point out that SGI's attempts to contribute code to XFS are frequently blocked by Red Hat without technical merit. Most recently we tried to submit code for the agskip mount option which SGI has been shipping for years. [http://oss.sgi.com/archives/xfs/2013-01/msg00561.html]

There were technical problems with the patch (e.g. race conditions), and it never got reposted by SGI, so that's SGI's failing to follow up in response to code review that is at fault. And there were design issues that we'd discussed months previous where we'd agreed that the mount options weren't the best way forward....

http://oss.sgi.com/archives/xfs/2013-01/msg00588.html

Quoted 4 lines

We asked for fields to be reserved in the new v3 inodes for parent pointers and allocation policies. That request was soundly rejected despite the existence of unreserved padding in the new inode format.
[http://oss.sgi.com/archives/xfs/2013-04/msg00214.html]

http://oss.sgi.com/archives/xfs/2013-04/msg00253.html

I asked for justification i.e. a design review of the feature that needed to increase the on-disk inode size by 16 bytes for a feature that had last been proposed to the community using a pure EA format. Again, SGI did not follow up with code or design or continue the discussion.

There's hardly a conspiracy here - getting a "you need to fix X" reponse or a "please demonstrate why" response is a normal part of the review process. The responsibility to follow up with the required fixes/information is solely on the person who proposed the code/feature in the first place.

Quoted 4 lines

The response
to code submitted by SGI has been so negative, we don't even bother submitting most of our code to the list anymore as long as it does not affect the on-disk format.

So "please fix/justify" responses with construct criticism to a handful of patches from SGI is so negative and hurtful that SGI has decided can't participate in upstream development for any new code it writes?

Quoted 5 lines

A reiterate my appreciation of Red Hat's contributions to XFS. However, I hope that you and others at Red Hat recognize that Red Hat is not the sole source for innovation and contributions to XFS. The playing field must be kept level and everyone in the community must be allowed to participate.

We have a level playing field. We've recently had significant contributions from several different sources, and they've all managed to handle the iterative review process just fine, following up when asked for more information or fixing problems with the code or pointing out the suggestions made during review are off-target and won't work. Some patch series get to version 7 or 8 before they pass review, yet those people have persisted and we've ended up with good code and cool new features.

Participation requires being open about what you are doing. Posting designs and ideas for comment, communicating your vision for the future, posting code early and often, etc. That enables others to participate at every stage and means that problems/issues are caught early and rejection/acceptance occurs long before final code is written. That's the way open source software is developed and most of the XFS developer community understand that.

Except, it appears, the maintainers.

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

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

Re: [PATCH 48/49] xfs: Add read-only support for dirent filetype field

On Mon, Aug 19, 2013 at 03:28:13PM +1000, Dave Chinner wrote:

| Participation requires being open about what you are doing. Posting
| designs and ideas for comment, communicating your vision for the
| future, posting code early and often, etc. That enables others to
| participate at every stage and means that problems/issues are caught
| early and rejection/acceptance occurs long before final code is
| written. That's the way open source software is developed and most
| of the XFS developer community understand that.

This is a statement we can all agree on.

| Except, it appears, the maintainers.

Don't blame the maintainer. I am not the maintainer. Send your insults my way, not to the maintainer.

Signature · 6 lines
Geoffrey Wehrman  651-683-5496  [email protected]

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

Re: [PATCH 48/49] xfs: Add read-only support for dirent filetype field

Quoted 9 lines · Geoffrey Wehrman

On Mon, Aug 19, 2013 at 03:28:13PM +1000, Dave Chinner wrote:

| Participation requires being open about what you are doing. Posting
| designs and ideas for comment, communicating your vision for the
| future, posting code early and often, etc. That enables others to
| participate at every stage and means that problems/issues are caught
| early and rejection/acceptance occurs long before final code is
| written. That's the way open source software is developed and most
| of the XFS developer community understand that.
Quoted 6 lines

This is a statement we can all agree on.

| Except, it appears, the maintainers.

Don't blame the maintainer. I am not the maintainer. Send your insults my way, not to the maintainer.

No insult, just an observation based on statements made by people from SGI.

Indeed, you can't have it both ways, Geoffrey. The only thing that gives you any weight in this discussion is that you are speaking on behalf of SGI as the maintainer. You're not an active community participant so if you are not speaking as an SGI XFS maintiner, then you have no standing to make (unfounded) accusations of bias and double standards.

Indeed, with all the roles SGI has split the XFS maintainership up into, there is only one way to refer to the maintainer as a whole:
SGI is the maintainer. I have no idea how to separate what anyone from SGI says as a personal opinion of that of the maintainer, and that is a large part of the problem we have here. Nobody can tell if someone from SGI is speaking as a maintainer or giving an opinion as a SGI employee. So, you end up being tarred with the same brush.

Now that I think about it, that is probably the underlying source of all the issues here. The "maintainer" is making conflicting decisions based on how each change impacts SGI's internal products, not what is in the best interests of the XFS community. The more I consider this, the more it explains the problems that we've been having.

Perhaps we should all go away for a while and consider this:

---

A Maintainer is the community advocate, shepherd and facilitator.

Maintainers lead by example - anything they directly want or need they write code for, demonstrating best practises in developing that code.

Maintainers show leadership. They communicate their vision for the future so that other people can see that vision and so can work together to acheive it. Maintainers are open to change, to see the bigger picture, to understand the visions communicated by other people, how to work those changes into their vision.

Maintainers interact with other developers and subsystems outside their immediate areas of responsibility. They are responsible for ensuring that their subsystems integrated effectively into the wider community at all points - architectural, code and community levels.

Maintainers don't make demands on developers or users - they are impartial and influence directions through discussion and code. The maintainer should not attempt to stop developers from taking different directions, but needs to be able to resolve alternate opinions in a manner acceptible to all parties.

Maintainers are among the most active individuals in the community. They support their users, triaging problems and providing bug fixes. They listen to their users to understand the problems they are having and determine what needs to be done to help them. The maintainer spends time to educate users, as a knowledgable user is a valuable resource that can help other users. They might even become a valuable developer given enough nuturing.

The maintainer role is to provide and environment that benefits the community. A maintainer puts the community first and the own interests second. The maintainer wants the community to develop and grow and improve, and will place the long term health of the community ahead of immediate personal or commercial gain.

In a commercial open source world, a vibrant community that the maintainer can influence and direct is far more valuable to the maintainer than a community that is at odds with the maintainer. A community that wants to help each other improve and improve quickly far outweighs any of the ongoing costs involved in facilitating such a community.

The role of maintainer is not a right - the maintainer is chosen through demonstration of the above traits and abilities. It doesn't matter what background you have or who you work for - the maintainer role is a position that is earnt through respect for your endeavours, and so is open to anyone of sufficient calibre.

In the XFS community, we strive to use best practices for our code and processes, and all developers should be striving to acheive the level of capability that would place them in consideration of the maintainer's role.

---

So, as a whole, let's reflect on this for a while before going any further. Reflect on where you think you fit, what you think your place is, whether you consider that you are fulfilling your place, and how you can improve on what you do and improve your contributions to the greater XFS community...

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

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

Re: [PATCH 48/49] xfs: Add read-only support for dirent filetype field

On Tue, Aug 20, 2013 at 12:23:25PM +1000, Dave Chinner wrote:

| Indeed, you can't have it both ways, Geoffrey. The only thing that
| gives you any weight in this discussion is that you are speaking on
| behalf of SGI as the maintainer. You're not an active community
| participant so if you are not speaking as an SGI XFS maintainer, then
| you have no standing to make (unfounded) accusations of bias and
| double standards.

What makes one an active community participant? Are only those who submit code considered active community participants? Who is the community?

All this time I thought that as user of Linux, occasional contributor (including source), occasional participant on the mailing list, I was a member of the community. I agree, I am not a full time participant. I have other responsibilities with my job and a life outside my job. XFS is only part of my responsibilities. Now I am being told that unless I participate full time, I don't have any standing in the community and am not allowed to participate even when there is an issue of interest to me.

| Indeed, with all the roles SGI has split the XFS maintainership up
| into, there is only one way to refer to the maintainer as a whole:
| SGI is the maintainer. I have no idea how to separate what anyone
| from SGI says as a personal opinion of that of the maintainer, and
| that is a large part of the problem we have here. Nobody can tell if
| someone from SGI is speaking as a maintainer or giving an opinion as
| a SGI employee. So, you end up being tarred with the same brush.

Ben is the maintainer. No one else at SGI speaks for Ben. Ben does receive a paycheck from SGI, but his primary interest as maintainer is not in the interests of SGI. SGI has its own source trees where the SGI open source version of XFS is maintained. Ben's maintainership role is for the community XFS, not the SGI XFS.

| Now that I think about it, that is probably the underlying source of
| all the issues here. The "maintainer" is making conflicting
| decisions based on how each change impacts SGI's internal products,
| not what is in the best interests of the XFS community. The more I
| consider this, the more it explains the problems that we've been
| having.

The problem is that the maintainer (Ben) listens to all interested parties and does not take direction exclusively from you, Red Hat, SuSE, SGI, IBM, Oracle, or anyone else. He is caught in the middle. Let's be open here. The current conflict is the result of me insisting that your plan and vision on a specific feature is not in the best interest of the community and you do not like the direction I have presented. It is great that you have a vision, but not everyone agrees with your vision. You are definitely the most significant current contributor of code to XFS. Of your recent patch set, 49 of 50 patches were accepted. And the one patch that was not accepted, I asked for you to rework. You refused. Mark agreed to rework your patch, and because of this Ben is accused of making conflicting decisions based on how each change impacts SGI's internal products, not what is in the best interests of the XFS community. Last time I checked, SGI was an active member of the XFS community even by your definition. Even so, I believe that the change I am requesting will benefit the entire XFS community, not just SGI. The problem I see here is that you are unwilling to compromise on your vision or on your interpretation of what is best for the community.

| Perhaps we should all go away for a while and consider this:

Please tell me, whose definition of maintainer is this and where did you obtain it from? I've searched for a definition of Maintainer, and didn't find anything close to this. Apparently this is your definition of Maintainer. While many points are good I don't agree wholesale. I must say though, and I think others (non-SGI) people on the list will agree, that Ben does an excellent job of fulfilling the role you describe.

| ---
| 
| A Maintainer is the community advocate, shepherd and facilitator.
| 
| Maintainers lead by example - anything they directly want or need
| they write code for, demonstrating best practices in developing that
| code.
| 
| Maintainers show leadership. They communicate their vision for the
| future so that other people can see that vision and so can work
| together to achieve it. Maintainers are open to change, to see the
| bigger picture, to understand the visions communicated by other
| people, how to work those changes into their vision.
| 
| Maintainers interact with other developers and subsystems outside
| their immediate areas of responsibility. They are responsible for
| ensuring that their subsystems integrated effectively into the wider
| community at all points - architectural, code and community levels.
| 
| Maintainers don't make demands on developers or users - they are
| impartial and influence directions through discussion and code. The
| maintainer should not attempt to stop developers from taking
| different directions, but needs to be able to resolve alternate
| opinions in a manner acceptable to all parties.
| 
| Maintainers are among the most active individuals in the community.
| They support their users, triaging problems and providing bug fixes.
| They listen to their users to understand the problems they are
| having and determine what needs to be done to help them. The
| maintainer spends time to educate users, as a knowledgeable user is a
| valuable resource that can help other users. They might even become
| a valuable developer given enough nurturing.
| 
| The maintainer role is to provide and environment that
| benefits the community. A maintainer puts the community first and
| the own interests second. The maintainer wants the community to
| develop and grow and improve, and will place the long term health of
| the community ahead of immediate personal or commercial gain.
| 
| In a commercial open source world, a vibrant community that the
| maintainer can influence and direct is far more valuable to the
| maintainer than a community that is at odds with the maintainer. A
| community that wants to help each other improve and improve quickly
| far outweighs any of the ongoing costs involved in facilitating
| such a community.
| 
| The role of maintainer is not a right - the maintainer is chosen
| through demonstration of the above traits and abilities. It doesn't
| matter what background you have or who you work for - the maintainer
| role is a position that is earned through respect for your
| endeavors, and so is open to anyone of sufficient caliber.
| 
| In the XFS community, we strive to use best practices for our code
| and processes, and all developers should be striving to achieve the
| level of capability that would place them in consideration of the
| maintainer's role.
| 
| ---
| 
| So, as a whole, let's reflect on this for a while before going
| any further.  Reflect on where you think you fit, what you think
| your place is, whether you consider that you are fulfilling your
| place, and how you can improve on what you do and improve your
| contributions to the greater XFS community...
| 
| Cheers,
| 
| Dave.
| -- 
| Dave Chinner
| [email protected]
Signature · 7 lines
Geoffrey Wehrman
[email protected]

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

Re: [PATCH 48/49] xfs: Add read-only support for dirent filetype field

Quoted 10 lines · Geoffrey Wehrman

The problem is that the maintainer (Ben) listens to all interested parties and does not take direction exclusively from you, Red Hat, SuSE, SGI, IBM, Oracle, or anyone else. He is caught in the middle. Let's be open here. The current conflict is the result of me insisting that your plan and vision on a specific feature is not in the best interest of the community and you do not like the direction I have presented. It is great that you have a vision, but not everyone agrees with your vision. You are definitely the most significant current contributor of code to XFS. Of your recent patch set, 49 of 50 patches were accepted. And the one patch that was not accepted, I asked for you to rework. You refused.

Quoted 8 lines

Mark agreed to rework your patch, and because of this Ben is accused of making conflicting decisions based on how each change impacts SGI's internal products, not what is in the best interests of the XFS community. Last time I checked, SGI was an active member of the XFS community even by your definition. Even so, I believe that the change I am requesting will benefit the entire XFS community, not just SGI. The problem I see here is that you are unwilling to compromise on your vision or on your interpretation of what is best for the community.

Getting someone to rework a patch is a burden on the one making the request - you have to convince them (or the broader list) that you have merit in your requested changes.

Usually, the best way to influence an upstream discussion is through submission of patches or sharing testing results. It can also be helpful to frame a request with a solid "this is what our customers need" type of request.

Regards,

Ric

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

#146 lore raw

Re: [PATCH 48/49] xfs: Add read-only support for dirent filetype field

In reply to Geoffrey Wehrman
Quoted 5 lines · Geoffrey Wehrman

I would like to take this opportunity to point out that SGI's attempts to contribute code to XFS are frequently blocked by Red Hat without technical merit. Most recently we tried to submit code for the agskip mount option which SGI has been shipping for years. [http://oss.sgi.com/archives/xfs/2013-01/msg00561.html]

Honestly, shipping it for years was SGI's first mistake. At that point you can't respond to upstream reviews, because you are committed to the patch as-is - it's already in the field. You can't argue from technical points; you need it merged because you shipped it. So all you can ask for is thumbs up or thumbs down; you got thumbs down.

Not going upstream first will almost always burn you; now you have extra maintenance burden forever. Which takes time away from your upstream presence, etc, etc.

Quoted 5 lines

We asked for fields to be reserved in the new v3 inodes for parent pointers and allocation policies. That request was soundly rejected despite the existence of unreserved padding in the new inode format.
[http://oss.sgi.com/archives/xfs/2013-04/msg00214.html] The response to code submitted by SGI has been so negative

The response, IIRC, was that we shouldn't reserve fields for unreviewed designs from the future. That's sound practice, IMHO, and I agree.

extN has weird, old, unused structure fields, because this principle wasn't followed. I've seen the counterexample, and it sucks.

TBH, if I went to btrfs or ext4, and said hey, please add these fields because I have a plan, they'd have told me no as well, and to come back with a patch which implements the plan, for review.

Quoted 3 lines

, we don't even bother
submitting most of our code to the list anymore as long as it does not affect the on-disk format.

That really is unfortunate. See above about how that is only going to hurt you, I'm afraid.

Quoted 5 lines

The list of features and capabilities that we
carry in our internally maintained source trees is significant and long:
DMAPI, behavior chains, agskip mount option, ibound mount option, etc. These are all features that have been rejected by the external community but are of value to SGI customers.

Sure, but their mere existence in your tree doesn't mean that it's the best solution. Upstream review & discussion can be arduous, but it finds & fixes things. Code written & shipped w/o 3rd party review tends to have more rough edges than if it had been wrung through 8 versions.

"Note: The ibound mount option is not compatible with the inode64 mount option. If you specify both options, the mount(8) command will ignore the first option specified. "

Review might have cleaned up that behavior. :)

Quoted 4 lines

A reiterate my appreciation of Red Hat's contributions to XFS. However, I hope that you and others at Red Hat recognize that Red Hat is not the sole source for innovation and contributions to XFS. The playing field must be kept level and everyone in the community must be allowed to participate.

Asking for justification, testing, adherence to best practices, patch modification cycles, hard questioning, design review, etc is the standard to which everyone should be held. It's how xfs has been developed upstream
for years, and what has made it the premier Linux filesystem. We owe
each other courtesy during the process, but hard questions and a high bar should not be perceived as discourtesy. If it really does get personal, and sometimes it does despite all our efforts, then point it out, and people should reset the discussion to the technical side.

Look, I'm trying to be master of 3 or more different Linux filesystems -
and probably doing a poor job of it. But the one thing that has impressed
me about XFS apart from the others is that for the most part, bad code doesn't get through. On-list review is rigorous, and code is held to very high standards. You have to be willing to get behind your proposal and make good technical arguments, and see it through to the end - or sometimes, lose the argument and regroup.

-Eric

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

#147 lore raw

Re: [PATCH 48/49] xfs: Add read-only support for dirent filetype field

In reply to Geoffrey Wehrman
Quoted 78 lines · Geoffrey Wehrman

On Wed, Aug 14, 2013 at 05:50:42PM +1000, Dave Chinner wrote:

| On Tue, Aug 13, 2013 at 10:42:32AM -0500, Mark Tinguely wrote:
| > On 08/12/13 19:50, Dave Chinner wrote:
| > >On Mon, Aug 12, 2013 at 08:25:23AM -0500, Mark Tinguely wrote:
| > >>On 08/11/13 19:59, Dave Chinner wrote:
| > >>>On Tue, Jul 30, 2013 at 02:10:32PM -0500, Mark Tinguely wrote:
| > >>>>On 07/19/13 01:25, Dave Chinner wrote:
| > >>>>>From: Dave Chinner<[email protected]>
| > >>>>>
| > >>>>>Add support for the file type field in directory entries so that
| > >>>>>readdir can return the type of the inode the dirent points to to
| > >>>>>userspace without first having to read the inode off disk.
| .....
| > >>>>>Signed-off-by: Dave Chinner<[email protected]>
| > >>>>>---
| > >>>>>
| > >>>>
| > >>>>>+static inline int xfs_sb_version_hasftype(struct xfs_sb *sbp)
| > >>>>>+{
| > >>>>>+	return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5&&
| > >>>>>+		xfs_sb_has_incompat_feature(sbp, XFS_SB_FEAT_INCOMPAT_FTYPE);
| > >>>>>  }
| > >>>>>
| > >>>>
| > >>>>This feature should support inode version 2 and 3.
| > >>>
| > >>>Has nothing to do with the inode version number - it has to do with
| > >>>the directory structure being modified.
| > >>>
| > >>>We're changing the directory structure for CRCs, and this builds on
| > >>>top of that. It is essentially part of the V3 directory format, and
| > >>>should be treated as such. Suggesting that we retrofit and support a
| > >>>modified v2 directory format is close to insane - instead of only
| > >>>having to test v2 vs v3 directory formats, you're suggesting we
| > >>>support v2 vs v2+dtype vs v3 vs v3+dtype. We simply do not have the
| > >>>resources to adequately test and support such an explosion of
| > >>>filesystem configurations.
| > >>>
| > >>>We've had this discussion before - new on-disk features go into the
| > >>>v5 superblock format - the v4 superblock format from this point
| > >>>onwards is essentially legacy support from an upstream development
| > >>>perspective.
| ....
| > >>>That said, there's nothing to stop anyone from backporting such a
| > >>>feature to an older kernel and maintaining it themselves - it's open
| > >>>source software. But the idea that development should be constrained
| > >>>by having to support both old and new formats is wrong - the old v4
| > >>>format should be considered stable and we need think very hard about
| > >>>changing it at all now, especially as much of the development focus
| > >>>is now shifting to taking advantage of the additions to the v5
| > >>>format....
| > >>
| > >>I guess we need more time to argue this out. It is not going into
| > >>Linux 3.12 as a crc feature only.
| > >
| > >Seriously?
| > 
| > yes seriously.
| 
| Great, another random roadblock from the XFS maintainers to deal
| with.

The addition of the file type field to directory entries is a great new feature. Your implementation of adding a "hidden" byte to the name field is especially clever. This is a feature that can benefit both dir2 and dir3 format filesystems and is completely independent of your CRC and self describing metadata feature work. I understand that you are not interested in porting the capability to dir2 format filesystems yourself and do not have the resources to provide the associated testing and support. Myself and others within SGI have discussed these issues, and we are willing to take on the work ourselves rather than have this feature go only into v5 superblock filesystems where the feature is only accessible to those who are willing to risk using experimental code. Given that SGI will be doing the work to support the file type field in dir2 format filesystems, it doesn't make sense to add the code to v5 filesystems until all of the work is complete as there could be additional considerations for the on disk changes.

Quoted 7 lines

We also noted that this feature should not be added to the kernel until userspace code is available to support this feature. Specifically, xfs_repair needs to validate and if needed repair the the file type field. Also, tests are needed to validate the new functionality. While I expect that you will provide this support for v5 superblock and dir3 filesystems, one of us at SGI will extend the support to v4 superblock and dir2 filesystems.

These requirements are very, very late in the process. Dave's work has been discussed for a long time in public, with plenty of time for input and cooperation and coordination.

If the type field is critical to SGI on V4 superblocks, I'd have expected to see patches from SGI by now, either prior to, or in coordination with, Dave's work. So it's hard for me to tell if this is a strategic requirement for you, or an effort to delay the CRC work which you seem to be uneasy with. Indeed, you floated this as a requirement many weeks (months?) ago, but as far as I know, no actual work or patches or proposals to implement it have been forthcoming from SGI.

I apologize for not being up to speed on the technical details of what it might take, but I figure surely SGI is on top of it, if you're signing up to do the work.

So I'd propose (and the guys in the trenches can bang this around) that if you are serious about this, you commit to producing patches which address your stated requirements without negatively affecting Dave's V5 design, with all necessary retesting, any of Dave's outstanding patches rebased as necessary, and everything ready for upstream integration on the original schedule.

You've had plenty of time to do this, but it's not been done AFAICT. I think you need to get busy and back up your words with patches pronto, or drop the above stated requirement; perhaps there is a way to add the support to V4 superblocks retroactively if you miss this window.

There may well be technical hurdles I'm not aware of, but I think we need to see SGI's proposed implementation to be able to discuss that efficiently.

-Eric

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

#148 lore raw

Re: [PATCH 48/49] xfs: Add read-only support for dirent filetype field

On Thu, Aug 15, 2013 at 11:50:08AM -0500, Eric Sandeen wrote:

| On 8/14/13 1:47 PM, Geoffrey Wehrman wrote:
| > On Wed, Aug 14, 2013 at 05:50:42PM +1000, Dave Chinner wrote:
| > | On Tue, Aug 13, 2013 at 10:42:32AM -0500, Mark Tinguely wrote:
| > | > On 08/12/13 19:50, Dave Chinner wrote:
| > | > >On Mon, Aug 12, 2013 at 08:25:23AM -0500, Mark Tinguely wrote:
| > | > >>On 08/11/13 19:59, Dave Chinner wrote:
| > | > >>>On Tue, Jul 30, 2013 at 02:10:32PM -0500, Mark Tinguely wrote:
| > | > >>>>On 07/19/13 01:25, Dave Chinner wrote:
| > | > >>>>>From: Dave Chinner<[email protected]>
| > | > >>>>>
| > | > >>>>>Add support for the file type field in directory entries so that
| > | > >>>>>readdir can return the type of the inode the dirent points to to
| > | > >>>>>userspace without first having to read the inode off disk.
| > | .....
| > | > >>>>>Signed-off-by: Dave Chinner<[email protected]>
| > | > >>>>>---
| > | > >>>>>
| > | > >>>>
| > | > >>>>>+static inline int xfs_sb_version_hasftype(struct xfs_sb *sbp)
| > | > >>>>>+{
| > | > >>>>>+	return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5&&
| > | > >>>>>+		xfs_sb_has_incompat_feature(sbp, XFS_SB_FEAT_INCOMPAT_FTYPE);
| > | > >>>>>  }
| > | > >>>>>
| > | > >>>>
| > | > >>>>This feature should support inode version 2 and 3.
| > | > >>>
| > | > >>>Has nothing to do with the inode version number - it has to do with
| > | > >>>the directory structure being modified.
| > | > >>>
| > | > >>>We're changing the directory structure for CRCs, and this builds on
| > | > >>>top of that. It is essentially part of the V3 directory format, and
| > | > >>>should be treated as such. Suggesting that we retrofit and support a
| > | > >>>modified v2 directory format is close to insane - instead of only
| > | > >>>having to test v2 vs v3 directory formats, you're suggesting we
| > | > >>>support v2 vs v2+dtype vs v3 vs v3+dtype. We simply do not have the
| > | > >>>resources to adequately test and support such an explosion of
| > | > >>>filesystem configurations.
| > | > >>>
| > | > >>>We've had this discussion before - new on-disk features go into the
| > | > >>>v5 superblock format - the v4 superblock format from this point
| > | > >>>onwards is essentially legacy support from an upstream development
| > | > >>>perspective.
| > | ....
| > | > >>>That said, there's nothing to stop anyone from backporting such a
| > | > >>>feature to an older kernel and maintaining it themselves - it's open
| > | > >>>source software. But the idea that development should be constrained
| > | > >>>by having to support both old and new formats is wrong - the old v4
| > | > >>>format should be considered stable and we need think very hard about
| > | > >>>changing it at all now, especially as much of the development focus
| > | > >>>is now shifting to taking advantage of the additions to the v5
| > | > >>>format....
| > | > >>
| > | > >>I guess we need more time to argue this out. It is not going into
| > | > >>Linux 3.12 as a crc feature only.
| > | > >
| > | > >Seriously?
| > | > 
| > | > yes seriously.
| > | 
| > | Great, another random roadblock from the XFS maintainers to deal
| > | with.
| > 
| > The addition of the file type field to directory entries is a great
| > new feature.  Your implementation of adding a "hidden" byte to the name
| > field is especially clever.  This is a feature that can benefit both
| > dir2 and dir3 format filesystems and is completely independent of your
| > CRC and self describing metadata feature work.  I understand that you
| > are not interested in porting the capability to dir2 format filesystems
| > yourself and do not have the resources to provide the associated testing
| > and support.  Myself and others within SGI have discussed these issues,
| > and we are willing to take on the work ourselves rather than have this
| > feature go only into v5 superblock filesystems where the feature is only
| > accessible to those who are willing to risk using experimental code.
| > Given that SGI will be doing the work to support the file type field
| > in dir2 format filesystems, it doesn't make sense to add the code to
| > v5 filesystems until all of the work is complete as there could be
| > additional considerations for the on disk changes.
| > 
| > We also noted that this feature should not be added to the kernel until
| > userspace code is available to support this feature.  Specifically,
| > xfs_repair needs to validate and if needed repair the the file type field.
| > Also, tests are needed to validate the new functionality.  While I
| > expect that you will provide this support for v5 superblock and dir3
| > filesystems, one of us at SGI will extend the support to v4 superblock
| > and dir2 filesystems.
| 
| These requirements are very, very late in the process.  Dave's work has
| been discussed for a long time in public, with plenty of time for input
| and cooperation and coordination.
| 
| If the type field is critical to SGI on V4 superblocks, I'd have expected
| to see patches from SGI by now, either prior to, or in coordination with,
| Dave's work.  So it's hard for me to tell if this is a strategic requirement
| for you, or an effort to delay the CRC work which you seem to be uneasy with.
| Indeed, you floated this as a requirement many weeks (months?) ago, but as far
| as I know, no actual work or patches or proposals to implement it have been
| forthcoming from SGI.
| 
| I apologize for not being up to speed on the technical details of what it
| might take, but I figure surely SGI is on top of it, if you're signing up
| to do the work.
| 
| So I'd propose (and the guys in the trenches can bang this around) that if
| you are serious about this, you commit to producing patches which address your
| stated requirements without negatively affecting Dave's V5 design, with all
| necessary retesting, any of Dave's outstanding patches rebased as necessary,
| and everything ready for upstream integration on the original schedule.
| 
| You've had plenty of time to do this, but it's not been done AFAICT.
| I think you need to get busy and back up your words with patches pronto, or drop
| the above stated requirement; perhaps there is a way to add the support to V4
| superblocks retroactively if you miss this window.
| 
| There may well be technical hurdles I'm not aware of, but I think we need to see
| SGI's proposed implementation to be able to discuss that efficiently.

I'll admit that I'm not a close follower of the oss-xfs mail list, but the first mention I can find of the dirent filetype field feature on the list is in Dave's patch posted July 19 along with 48 other patches.
http://oss.sgi.com/archives/xfs/2013-07/msg00422.html

If there was discussion on the list about this feature prior to the above posting, I apologize. Had I known the dirent filetype feature was coming and would not be supported in v4 filesystems, I would have been able to start this conversation earlier.

Signature · 6 lines
Geoffrey Wehrman  651-683-5496  [email protected]

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

Re: [PATCH 48/49] xfs: Add read-only support for dirent filetype field

Quoted 123 lines · Geoffrey Wehrman

On Thu, Aug 15, 2013 at 11:50:08AM -0500, Eric Sandeen wrote:

| On 8/14/13 1:47 PM, Geoffrey Wehrman wrote:
| > On Wed, Aug 14, 2013 at 05:50:42PM +1000, Dave Chinner wrote:
| > | On Tue, Aug 13, 2013 at 10:42:32AM -0500, Mark Tinguely wrote:
| > | > On 08/12/13 19:50, Dave Chinner wrote:
| > | > >On Mon, Aug 12, 2013 at 08:25:23AM -0500, Mark Tinguely wrote:
| > | > >>On 08/11/13 19:59, Dave Chinner wrote:
| > | > >>>On Tue, Jul 30, 2013 at 02:10:32PM -0500, Mark Tinguely wrote:
| > | > >>>>On 07/19/13 01:25, Dave Chinner wrote:
| > | > >>>>>From: Dave Chinner<[email protected]>
| > | > >>>>>
| > | > >>>>>Add support for the file type field in directory entries so that
| > | > >>>>>readdir can return the type of the inode the dirent points to to
| > | > >>>>>userspace without first having to read the inode off disk.
| > | .....
| > | > >>>>>Signed-off-by: Dave Chinner<[email protected]>
| > | > >>>>>---
| > | > >>>>>
| > | > >>>>
| > | > >>>>>+static inline int xfs_sb_version_hasftype(struct xfs_sb *sbp)
| > | > >>>>>+{
| > | > >>>>>+	return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5&&
| > | > >>>>>+		xfs_sb_has_incompat_feature(sbp, XFS_SB_FEAT_INCOMPAT_FTYPE);
| > | > >>>>>  }
| > | > >>>>>
| > | > >>>>
| > | > >>>>This feature should support inode version 2 and 3.
| > | > >>>
| > | > >>>Has nothing to do with the inode version number - it has to do with
| > | > >>>the directory structure being modified.
| > | > >>>
| > | > >>>We're changing the directory structure for CRCs, and this builds on
| > | > >>>top of that. It is essentially part of the V3 directory format, and
| > | > >>>should be treated as such. Suggesting that we retrofit and support a
| > | > >>>modified v2 directory format is close to insane - instead of only
| > | > >>>having to test v2 vs v3 directory formats, you're suggesting we
| > | > >>>support v2 vs v2+dtype vs v3 vs v3+dtype. We simply do not have the
| > | > >>>resources to adequately test and support such an explosion of
| > | > >>>filesystem configurations.
| > | > >>>
| > | > >>>We've had this discussion before - new on-disk features go into the
| > | > >>>v5 superblock format - the v4 superblock format from this point
| > | > >>>onwards is essentially legacy support from an upstream development
| > | > >>>perspective.
| > | ....
| > | > >>>That said, there's nothing to stop anyone from backporting such a
| > | > >>>feature to an older kernel and maintaining it themselves - it's open
| > | > >>>source software. But the idea that development should be constrained
| > | > >>>by having to support both old and new formats is wrong - the old v4
| > | > >>>format should be considered stable and we need think very hard about
| > | > >>>changing it at all now, especially as much of the development focus
| > | > >>>is now shifting to taking advantage of the additions to the v5
| > | > >>>format....
| > | > >>
| > | > >>I guess we need more time to argue this out. It is not going into
| > | > >>Linux 3.12 as a crc feature only.
| > | > >
| > | > >Seriously?
| > | > 
| > | > yes seriously.
| > | 
| > | Great, another random roadblock from the XFS maintainers to deal
| > | with.
| > 
| > The addition of the file type field to directory entries is a great
| > new feature.  Your implementation of adding a "hidden" byte to the name
| > field is especially clever.  This is a feature that can benefit both
| > dir2 and dir3 format filesystems and is completely independent of your
| > CRC and self describing metadata feature work.  I understand that you
| > are not interested in porting the capability to dir2 format filesystems
| > yourself and do not have the resources to provide the associated testing
| > and support.  Myself and others within SGI have discussed these issues,
| > and we are willing to take on the work ourselves rather than have this
| > feature go only into v5 superblock filesystems where the feature is only
| > accessible to those who are willing to risk using experimental code.
| > Given that SGI will be doing the work to support the file type field
| > in dir2 format filesystems, it doesn't make sense to add the code to
| > v5 filesystems until all of the work is complete as there could be
| > additional considerations for the on disk changes.
| > 
| > We also noted that this feature should not be added to the kernel until
| > userspace code is available to support this feature.  Specifically,
| > xfs_repair needs to validate and if needed repair the the file type field.
| > Also, tests are needed to validate the new functionality.  While I
| > expect that you will provide this support for v5 superblock and dir3
| > filesystems, one of us at SGI will extend the support to v4 superblock
| > and dir2 filesystems.
| 
| These requirements are very, very late in the process.  Dave's work has
| been discussed for a long time in public, with plenty of time for input
| and cooperation and coordination.
| 
| If the type field is critical to SGI on V4 superblocks, I'd have expected
| to see patches from SGI by now, either prior to, or in coordination with,
| Dave's work.  So it's hard for me to tell if this is a strategic requirement
| for you, or an effort to delay the CRC work which you seem to be uneasy with.
| Indeed, you floated this as a requirement many weeks (months?) ago, but as far
| as I know, no actual work or patches or proposals to implement it have been
| forthcoming from SGI.
| 
| I apologize for not being up to speed on the technical details of what it
| might take, but I figure surely SGI is on top of it, if you're signing up
| to do the work.
| 
| So I'd propose (and the guys in the trenches can bang this around) that if
| you are serious about this, you commit to producing patches which address your
| stated requirements without negatively affecting Dave's V5 design, with all
| necessary retesting, any of Dave's outstanding patches rebased as necessary,
| and everything ready for upstream integration on the original schedule.
| 
| You've had plenty of time to do this, but it's not been done AFAICT.
| I think you need to get busy and back up your words with patches pronto, or drop
| the above stated requirement; perhaps there is a way to add the support to V4
| superblocks retroactively if you miss this window.
| 
| There may well be technical hurdles I'm not aware of, but I think we need to see
| SGI's proposed implementation to be able to discuss that efficiently.

I'll admit that I'm not a close follower of the oss-xfs mail list, but the first mention I can find of the dirent filetype field feature on the list is in Dave's patch posted July 19 along with 48 other patches.
http://oss.sgi.com/archives/xfs/2013-07/msg00422.html

Quoted 4 lines

If there was discussion on the list about this feature prior to the above posting, I apologize. Had I known the dirent filetype feature was coming and would not be supported in v4 filesystems, I would have been able to start this conversation earlier.

You brought this topic up on an xfs community call months ago, as I recall. I thought we had put it to rest, because we didn't hear from you again until now.

Am I misremembering?

-Eric

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

#150 lore raw

Re: [PATCH 48/49] xfs: Add read-only support for dirent filetype field

On Thu, Aug 15, 2013 at 01:41:15PM -0500, Eric Sandeen wrote:

| 
| You brought this topic up on an xfs community call months ago,
| as I recall.  I thought we had put it to rest, because we didn't hear
| from you again until now.
| 
| Am I misremembering?

The issue I brought up before was with one of two aspects of v5 superblock filesystems.
- The fact that CRCs cannot be disabled in a v5 superblock filesystem. I capitulated on this issue on the grounds that v5 superblock filesystems are experimental only, and I have the opportunity to provide the code myself to disable CRCs in a v5 superblock filesystem.
- v5 superblock filesystem minimum inode size is 512 bytes. Dave pointed out in a followup e-mail that v5 superblock inodes have bloated so that they no longer fit in 256 bytes.
http://oss.sgi.com/archives/xfs/2013-06/msg00726.html

Yes, I have had recent issues with how Dave is implementing some of his features. My recent complaint is unrelated to the previous two. The dirent filetype feature is not dependent neither on v5 superblock nor on v3 directory block for technical reasons, only by preference. I do no sit around looking for excuses to throw barriers in Dave's way. My only motivation is to speak up when I feel a decision has been made which is not beneficial to the XFS community.

Signature · 6 lines
Geoffrey Wehrman  651-683-5496  [email protected]

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

Re: [PATCH 48/49] xfs: Add read-only support for dirent filetype field

In reply to Eric Sandeen

Hey Eric,

Quoted 87 lines · Eric Sandeen
Quoted 78 lines · Geoffrey Wehrman

On Wed, Aug 14, 2013 at 05:50:42PM +1000, Dave Chinner wrote:

| On Tue, Aug 13, 2013 at 10:42:32AM -0500, Mark Tinguely wrote:
| > On 08/12/13 19:50, Dave Chinner wrote:
| > >On Mon, Aug 12, 2013 at 08:25:23AM -0500, Mark Tinguely wrote:
| > >>On 08/11/13 19:59, Dave Chinner wrote:
| > >>>On Tue, Jul 30, 2013 at 02:10:32PM -0500, Mark Tinguely wrote:
| > >>>>On 07/19/13 01:25, Dave Chinner wrote:
| > >>>>>From: Dave Chinner<[email protected]>
| > >>>>>
| > >>>>>Add support for the file type field in directory entries so that
| > >>>>>readdir can return the type of the inode the dirent points to to
| > >>>>>userspace without first having to read the inode off disk.
| .....
| > >>>>>Signed-off-by: Dave Chinner<[email protected]>
| > >>>>>---
| > >>>>>
| > >>>>
| > >>>>>+static inline int xfs_sb_version_hasftype(struct xfs_sb *sbp)
| > >>>>>+{
| > >>>>>+	return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5&&
| > >>>>>+		xfs_sb_has_incompat_feature(sbp, XFS_SB_FEAT_INCOMPAT_FTYPE);
| > >>>>>  }
| > >>>>>
| > >>>>
| > >>>>This feature should support inode version 2 and 3.
| > >>>
| > >>>Has nothing to do with the inode version number - it has to do with
| > >>>the directory structure being modified.
| > >>>
| > >>>We're changing the directory structure for CRCs, and this builds on
| > >>>top of that. It is essentially part of the V3 directory format, and
| > >>>should be treated as such. Suggesting that we retrofit and support a
| > >>>modified v2 directory format is close to insane - instead of only
| > >>>having to test v2 vs v3 directory formats, you're suggesting we
| > >>>support v2 vs v2+dtype vs v3 vs v3+dtype. We simply do not have the
| > >>>resources to adequately test and support such an explosion of
| > >>>filesystem configurations.
| > >>>
| > >>>We've had this discussion before - new on-disk features go into the
| > >>>v5 superblock format - the v4 superblock format from this point
| > >>>onwards is essentially legacy support from an upstream development
| > >>>perspective.
| ....
| > >>>That said, there's nothing to stop anyone from backporting such a
| > >>>feature to an older kernel and maintaining it themselves - it's open
| > >>>source software. But the idea that development should be constrained
| > >>>by having to support both old and new formats is wrong - the old v4
| > >>>format should be considered stable and we need think very hard about
| > >>>changing it at all now, especially as much of the development focus
| > >>>is now shifting to taking advantage of the additions to the v5
| > >>>format....
| > >>
| > >>I guess we need more time to argue this out. It is not going into
| > >>Linux 3.12 as a crc feature only.
| > >
| > >Seriously?
| > 
| > yes seriously.
| 
| Great, another random roadblock from the XFS maintainers to deal
| with.

The addition of the file type field to directory entries is a great new feature. Your implementation of adding a "hidden" byte to the name field is especially clever. This is a feature that can benefit both dir2 and dir3 format filesystems and is completely independent of your CRC and self describing metadata feature work. I understand that you are not interested in porting the capability to dir2 format filesystems yourself and do not have the resources to provide the associated testing and support. Myself and others within SGI have discussed these issues, and we are willing to take on the work ourselves rather than have this feature go only into v5 superblock filesystems where the feature is only accessible to those who are willing to risk using experimental code. Given that SGI will be doing the work to support the file type field in dir2 format filesystems, it doesn't make sense to add the code to v5 filesystems until all of the work is complete as there could be additional considerations for the on disk changes.

Quoted 7 lines

We also noted that this feature should not be added to the kernel until userspace code is available to support this feature. Specifically, xfs_repair needs to validate and if needed repair the the file type field. Also, tests are needed to validate the new functionality. While I expect that you will provide this support for v5 superblock and dir3 filesystems, one of us at SGI will extend the support to v4 superblock and dir2 filesystems.

Quoted 8 lines

These requirements are very, very late in the process. Dave's work has been discussed for a long time in public, with plenty of time for input and cooperation and coordination.

If the type field is critical to SGI on V4 superblocks, I'd have expected to see patches from SGI by now, either prior to, or in coordination with, Dave's work. So it's hard for me to tell if this is a strategic requirement for you, or an effort to delay the CRC work which you seem to be uneasy with.

Nah. SGI has zero interest in delaying the CRC work unnecessarily, but try to keep in mind we have other things going on too. In fact we behind on other work because we pushed to get the CRC work reviewed and pulled in.

/me plays the world's smallest violin.

Quoted 8 lines

Indeed, you floated this as a requirement many weeks (months?) ago, but as far as I know, no actual work or patches or proposals to implement it have been forthcoming from SGI.

I apologize for not being up to speed on the technical details of what it might take, but I figure surely SGI is on top of it, if you're signing up to do the work.

Quoted 5 lines

So I'd propose (and the guys in the trenches can bang this around) that if you are serious about this, you commit to producing patches which address your stated requirements without negatively affecting Dave's V5 design, with all necessary retesting, any of Dave's outstanding patches rebased as necessary, and everything ready for upstream integration on the original schedule.

Mmm but I'm not seeing the connection between the dirent feature and the v5 design. We did relax some of the usual requirements (e.g. userspace support, tests, etc) for the v5 design because it is experimental, and that's fine. The work to finish that up is still ongoing, and that's cool... But from my standpoint, it seems like we're taking an unrelated feature, calling it part of the CRC work, and then expecting that we'll pull it in under the relaxed requirements for experimental code... And FWICS there is no technical reqirement that this feature be limited to v5 super blocks. We should have tests and xfs_repair bits to go with this, right? So I think Mark and Geoffrey are justified in pushing back, or pretty soon we are going to have a xfs v5 superblock kitchen sink? ;P

As usual this seems to have been blown somewhat out of proportion... It'll be good to have a call and get this thoroughly aired. Geez. Mark shows a little backbone and everybody freaks out. Classic XFS list.

Thanks,
Ben

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

#152 lore raw

Re: [PATCH 48/49] xfs: Add read-only support for dirent filetype field

In reply to Dave Chinner

Hey Gents,

Quoted 26 lines · Dave Chinner

From: Dave Chinner <[email protected]>

Add support for the file type field in directory entries so that readdir can return the type of the inode the dirent points to to userspace without first having to read the inode off disk.

The encoding of the type field is a single byte that is added to the end of the directory entry name length. For all intents and purposes, it appends a "hidden" byte to the name field which contains the type information. As the directory entry is already of dynamic size, helpers are already required to access and decode the direct entry structures.

Hence the relevent extraction and iteration helpers are updated to understand the hidden byte. Helpers for reading and writing the filetype field from the directory entries are also added. Only the read helpers are used by this patch. It also adds all the code necessary to read the type information out of the dirents on disk.

Further we add the superblock feature bit and helpers to indicate that we understand the on-disk format change. This is not a compatible change - existing kernels cannot read the new format successfully - so an incompatible feature flag is added. We don't yet allow filesystems to mount with this flag yet - that will be added once write support is added.

Quoted 6 lines

Finally, the code to take the type from the VFS, convert it to an XFS on-disk type and put it into the xfs_name structures passed around is added, but the directory code does not use this field yet. That will be in the next patch.

After some discussion during our weekly call I believe we have come to an agreement regarding this feature. I wrote some things down:

* Eric volunteered to do an xfstest
* xfs_repair, Dave said he was working on this
* v4 support in the kernel to be done by Mark
* v4 support for mkfs.xfs to be done by Mark
* Plan for 3.13

With uncharacteristic promptness I have posted 'full' meeting notes here:

http://www.xfs.org/index.php/Meeting_notes_for_2013#Meeting_of_Aug_15

With that I hope that we can move on and put the flames to rest for awhile. At this point I believe the rest of this series is all applied. I'll push patch 50 tomorrow. We'll be pulling in work from Chandra, Dwight, and Zwu shortly. Thanks to Eric for playing the Ambassador.

Regards,
Ben

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

#153 lore raw

PATCH 49/49 xfs: Add write support for dirent filetype field

In reply to Dave Chinner

From: Dave Chinner <[email protected]>

Add support to propagate and add filetype values into the on-disk directs. This involves passing the filetype into the xfs_da_args structure along with the name and namelength for direct operations, and encoding it into the dirent at the same time we write the inode number into the dirent.

With write support, add the feature flag to the XFS_SB_FEAT_INCOMPAT_ALL mask so we can now mount filesystems with this feature set.

Performance of directory recursion is now much improved. Parallel walk of ~50 million directory entries across hundreds of directories improves significantly. Unpatched, no CRCs:

Walking via ls -R

real    3m19.886s
user    6m36.960s
sys     28m19.087s

THis is doing roughly 500 getdents() calls per second, and 250,000 inode lookups per second to determine the inode type at roughly 17,000 read IOPS. CPU usage is 90% kernel space.

With dtype support patched in and the fileset recreated with CRCs enabled:

Walking via ls -R

real    0m31.316s
user    6m32.975s
sys     0m21.111s

This is doing roughly 3500 getdents() calls per second at 16,000 IOPS. There are no inode lookups at all. CPU usages is almost 100% userspace.

This is a big win for recursive directory walks that only need to find file names and file types.

---
 fs/xfs/xfs_dir2.c       |  3 +++
 fs/xfs/xfs_dir2_block.c |  7 +++++++
 fs/xfs/xfs_dir2_data.c  |  2 ++
 fs/xfs/xfs_dir2_leaf.c  |  3 +++
 fs/xfs/xfs_dir2_node.c  |  3 +++
 fs/xfs/xfs_dir2_sf.c    | 35 +++++++++++++++++++++++++++--------
 fs/xfs/xfs_sb.h         |  3 ++-
 7 files changed, 47 insertions(+), 9 deletions(-)
fs/xfs/xfs_dir2.c +3 -0
index f9825b1..d3ff96c 100644
@@ -209,6 +209,7 @@ xfs_dir_createname(
 	memset(&args, 0, sizeof(xfs_da_args_t));
 	args.name = name->name;
 	args.namelen = name->len;
+	args.filetype = name->type;
 	args.hashval = dp->i_mount->m_dirnameops->hashname(name);
 	args.inumber = inum;
 	args.dp = dp;
@@ -283,6 +284,7 @@ xfs_dir_lookup(
 	memset(&args, 0, sizeof(xfs_da_args_t));
 	args.name = name->name;
 	args.namelen = name->len;
+	args.filetype = name->type;
 	args.hashval = dp->i_mount->m_dirnameops->hashname(name);
 	args.dp = dp;
 	args.whichfork = XFS_DATA_FORK;
@@ -338,6 +340,7 @@ xfs_dir_removename(
 	memset(&args, 0, sizeof(xfs_da_args_t));
 	args.name = name->name;
 	args.namelen = name->len;
+	args.filetype = name->type;
 	args.hashval = dp->i_mount->m_dirnameops->hashname(name);
 	args.inumber = ino;
 	args.dp = dp;
fs/xfs/xfs_dir2_block.c +7 -0
index 1cd2f56..0957aa9 100644
@@ -549,6 +549,7 @@ xfs_dir2_block_addname(
 	dep->inumber = cpu_to_be64(args->inumber);
 	dep->namelen = args->namelen;
 	memcpy(dep->name, args->name, args->namelen);
+	xfs_dir3_dirent_put_ftype(mp, dep, args->filetype);
 	tagp = xfs_dir3_data_entry_tag_p(mp, dep);
 	*tagp = cpu_to_be16((char *)dep - (char *)hdr);
 	/*
@@ -641,6 +642,7 @@ xfs_dir2_block_lookup(
 	 * Fill in inode number, CI name if appropriate, release the block.
 	 */
 	args->inumber = be64_to_cpu(dep->inumber);
+	args->filetype = xfs_dir3_dirent_get_ftype(mp, dep);
 	error = xfs_dir_cilookup_result(args, dep->name, dep->namelen);
 	xfs_trans_brelse(args->trans, bp);
 	return XFS_ERROR(error);
@@ -873,6 +875,7 @@ xfs_dir2_block_replace(
 	 * Change the inode number to the new value.
 	 */
 	dep->inumber = cpu_to_be64(args->inumber);
+	xfs_dir3_dirent_put_ftype(mp, dep, args->filetype);
 	xfs_dir2_data_log_entry(args->trans, bp, dep);
 	xfs_dir3_data_check(dp, bp);
 	return 0;
@@ -1159,6 +1162,7 @@ xfs_dir2_sf_to_block(
 	dep->inumber = cpu_to_be64(dp->i_ino);
 	dep->namelen = 1;
 	dep->name[0] = '.';
+	xfs_dir3_dirent_put_ftype(mp, dep, XFS_DIR3_FT_DIR);
 	tagp = xfs_dir3_data_entry_tag_p(mp, dep);
 	*tagp = cpu_to_be16((char *)dep - (char *)hdr);
 	xfs_dir2_data_log_entry(tp, bp, dep);
@@ -1172,6 +1176,7 @@ xfs_dir2_sf_to_block(
 	dep->inumber = cpu_to_be64(xfs_dir2_sf_get_parent_ino(sfp));
 	dep->namelen = 2;
 	dep->name[0] = dep->name[1] = '.';
+	xfs_dir3_dirent_put_ftype(mp, dep, XFS_DIR3_FT_DIR);
 	tagp = xfs_dir3_data_entry_tag_p(mp, dep);
 	*tagp = cpu_to_be16((char *)dep - (char *)hdr);
 	xfs_dir2_data_log_entry(tp, bp, dep);
@@ -1219,6 +1224,8 @@ xfs_dir2_sf_to_block(
 		dep = (xfs_dir2_data_entry_t *)((char *)hdr + newoffset);
 		dep->inumber = cpu_to_be64(xfs_dir3_sfe_get_ino(mp, sfp, sfep));
 		dep->namelen = sfep->namelen;
+		xfs_dir3_dirent_put_ftype(mp, dep,
+					xfs_dir3_sfe_get_ftype(mp, sfp, sfep));
 		memcpy(dep->name, sfep->name, dep->namelen);
 		tagp = xfs_dir3_data_entry_tag_p(mp, dep);
 		*tagp = cpu_to_be16((char *)dep - (char *)hdr);
fs/xfs/xfs_dir2_data.c +2 -0
index 1b59e43..47e1326 100644
@@ -149,6 +149,8 @@ __xfs_dir3_data_check(
 		XFS_WANT_CORRUPTED_RETURN(
 			be16_to_cpu(*xfs_dir3_data_entry_tag_p(mp, dep)) ==
 					       (char *)dep - (char *)hdr);
+		XFS_WANT_CORRUPTED_RETURN(
+			xfs_dir3_dirent_get_ftype(mp, dep) < XFS_DIR3_FT_MAX);
 		count++;
 		lastfree = 0;
 		if (hdr->magic == cpu_to_be32(XFS_DIR2_BLOCK_MAGIC) ||
fs/xfs/xfs_dir2_leaf.c +3 -0
index 887b1bd..08984ee 100644
@@ -897,6 +897,7 @@ xfs_dir2_leaf_addname(
 	dep->inumber = cpu_to_be64(args->inumber);
 	dep->namelen = args->namelen;
 	memcpy(dep->name, args->name, dep->namelen);
+	xfs_dir3_dirent_put_ftype(mp, dep, args->filetype);
 	tagp = xfs_dir3_data_entry_tag_p(mp, dep);
 	*tagp = cpu_to_be16((char *)dep - (char *)hdr);
 	/*
@@ -1225,6 +1226,7 @@ xfs_dir2_leaf_lookup(
 	 * Return the found inode number & CI name if appropriate
 	 */
 	args->inumber = be64_to_cpu(dep->inumber);
+	args->filetype = xfs_dir3_dirent_get_ftype(dp->i_mount, dep);
 	error = xfs_dir_cilookup_result(args, dep->name, dep->namelen);
 	xfs_trans_brelse(tp, dbp);
 	xfs_trans_brelse(tp, lbp);
@@ -1555,6 +1557,7 @@ xfs_dir2_leaf_replace(
 	 * Put the new inode number in, log it.
 	 */
 	dep->inumber = cpu_to_be64(args->inumber);
+	xfs_dir3_dirent_put_ftype(dp->i_mount, dep, args->filetype);
 	tp = args->trans;
 	xfs_dir2_data_log_entry(tp, dbp, dep);
 	xfs_dir3_leaf_check(dp->i_mount, lbp);
fs/xfs/xfs_dir2_node.c +3 -0
index 49f1e9e..4c3dba7 100644
@@ -816,6 +816,7 @@ xfs_dir2_leafn_lookup_for_entry(
 				xfs_trans_brelse(tp, state->extrablk.bp);
 			args->cmpresult = cmp;
 			args->inumber = be64_to_cpu(dep->inumber);
+			args->filetype = xfs_dir3_dirent_get_ftype(mp, dep);
 			*indexp = index;
 			state->extravalid = 1;
 			state->extrablk.bp = curbp;
@@ -2007,6 +2008,7 @@ xfs_dir2_node_addname_int(
 	dep->inumber = cpu_to_be64(args->inumber);
 	dep->namelen = args->namelen;
 	memcpy(dep->name, args->name, dep->namelen);
+	xfs_dir3_dirent_put_ftype(mp, dep, args->filetype);
 	tagp = xfs_dir3_data_entry_tag_p(mp, dep);
 	*tagp = cpu_to_be16((char *)dep - (char *)hdr);
 	xfs_dir2_data_log_entry(tp, dbp, dep);
@@ -2227,6 +2229,7 @@ xfs_dir2_node_replace(
 		 * Fill in the new inode number and log the entry.
 		 */
 		dep->inumber = cpu_to_be64(inum);
+		xfs_dir3_dirent_put_ftype(state->mp, dep, args->filetype);
 		xfs_dir2_data_log_entry(args->trans, state->extrablk.bp, dep);
 		rval = 0;
 	}
fs/xfs/xfs_dir2_sf.c +27 -8
index bd14e1a..bb6e284 100644
@@ -333,6 +333,8 @@ xfs_dir2_block_to_sf(
 			memcpy(sfep->name, dep->name, dep->namelen);
 			xfs_dir3_sfe_put_ino(mp, sfp, sfep,
 					     be64_to_cpu(dep->inumber));
+			xfs_dir3_sfe_put_ftype(mp, sfp, sfep,
+					xfs_dir3_dirent_get_ftype(mp, dep));
 
 			sfep = xfs_dir3_sf_nextentry(mp, sfp, sfep);
 		}
@@ -496,6 +498,8 @@ xfs_dir2_sf_addname_easy(
 	xfs_dir2_sf_put_offset(sfep, offset);
 	memcpy(sfep->name, args->name, sfep->namelen);
 	xfs_dir3_sfe_put_ino(dp->i_mount, sfp, sfep, args->inumber);
+	xfs_dir3_sfe_put_ftype(dp->i_mount, sfp, sfep, args->filetype);
+
 	/*
 	 * Update the header and inode.
 	 */
@@ -589,6 +593,7 @@ xfs_dir2_sf_addname_hard(
 	xfs_dir2_sf_put_offset(sfep, offset);
 	memcpy(sfep->name, args->name, sfep->namelen);
 	xfs_dir3_sfe_put_ino(mp, sfp, sfep, args->inumber);
+	xfs_dir3_sfe_put_ftype(mp, sfp, sfep, args->filetype);
 	sfp->count++;
 #if XFS_BIG_INUMS
 	if (args->inumber > XFS_DIR2_MAX_SHORT_INUM && !objchange)
@@ -825,6 +830,7 @@ xfs_dir2_sf_lookup(
 	if (args->namelen == 1 && args->name[0] == '.') {
 		args->inumber = dp->i_ino;
 		args->cmpresult = XFS_CMP_EXACT;
+		args->filetype = XFS_DIR3_FT_DIR;
 		return XFS_ERROR(EEXIST);
 	}
 	/*
@@ -834,6 +840,7 @@ xfs_dir2_sf_lookup(
 	    args->name[0] == '.' && args->name[1] == '.') {
 		args->inumber = xfs_dir2_sf_get_parent_ino(sfp);
 		args->cmpresult = XFS_CMP_EXACT;
+		args->filetype = XFS_DIR3_FT_DIR;
 		return XFS_ERROR(EEXIST);
 	}
 	/*
@@ -853,6 +860,8 @@ xfs_dir2_sf_lookup(
 			args->cmpresult = cmp;
 			args->inumber = xfs_dir3_sfe_get_ino(dp->i_mount,
 							     sfp, sfep);
+			args->filetype = xfs_dir3_sfe_get_ftype(dp->i_mount,
+								sfp, sfep);
 			if (cmp == XFS_CMP_EXACT)
 				return XFS_ERROR(EEXIST);
 			ci_sfep = sfep;
@@ -1052,6 +1061,8 @@ xfs_dir2_sf_replace(
 #endif
 				xfs_dir3_sfe_put_ino(dp->i_mount, sfp, sfep,
 						     args->inumber);
+				xfs_dir3_sfe_put_ftype(dp->i_mount, sfp, sfep,
+						       args->filetype);
 				break;
 			}
 		}
@@ -1118,10 +1129,12 @@ xfs_dir2_sf_toino4(
 	int			oldsize;	/* old inode size */
 	xfs_dir2_sf_entry_t	*sfep;		/* new sf entry */
 	xfs_dir2_sf_hdr_t	*sfp;		/* new sf directory */
+	struct xfs_mount	*mp;
 
 	trace_xfs_dir2_sf_toino4(args);
 
 	dp = args->dp;
+	mp = dp->i_mount;
 
 	/*
 	 * Copy the old directory to the buffer.
@@ -1159,13 +1172,15 @@ xfs_dir2_sf_toino4(
 	for (i = 0, sfep = xfs_dir2_sf_firstentry(sfp),
 		    oldsfep = xfs_dir2_sf_firstentry(oldsfp);
 	     i < sfp->count;
-	     i++, sfep = xfs_dir3_sf_nextentry(dp->i_mount, sfp, sfep),
-		  oldsfep = xfs_dir3_sf_nextentry(dp->i_mount, oldsfp, oldsfep)) {
+	     i++, sfep = xfs_dir3_sf_nextentry(mp, sfp, sfep),
+		  oldsfep = xfs_dir3_sf_nextentry(mp, oldsfp, oldsfep)) {
 		sfep->namelen = oldsfep->namelen;
 		sfep->offset = oldsfep->offset;
 		memcpy(sfep->name, oldsfep->name, sfep->namelen);
-		xfs_dir3_sfe_put_ino(dp->i_mount, sfp, sfep,
-			xfs_dir3_sfe_get_ino(dp->i_mount, oldsfp, oldsfep));
+		xfs_dir3_sfe_put_ino(mp, sfp, sfep,
+			xfs_dir3_sfe_get_ino(mp, oldsfp, oldsfep));
+		xfs_dir3_sfe_put_ftype(mp, sfp, sfep,
+			xfs_dir3_sfe_get_ftype(mp, oldsfp, oldsfep));
 	}
 	/*
 	 * Clean up the inode.
@@ -1193,10 +1208,12 @@ xfs_dir2_sf_toino8(
 	int			oldsize;	/* old inode size */
 	xfs_dir2_sf_entry_t	*sfep;		/* new sf entry */
 	xfs_dir2_sf_hdr_t	*sfp;		/* new sf directory */
+	struct xfs_mount	*mp;
 
 	trace_xfs_dir2_sf_toino8(args);
 
 	dp = args->dp;
+	mp = dp->i_mount;
 
 	/*
 	 * Copy the old directory to the buffer.
@@ -1234,13 +1251,15 @@ xfs_dir2_sf_toino8(
 	for (i = 0, sfep = xfs_dir2_sf_firstentry(sfp),
 		    oldsfep = xfs_dir2_sf_firstentry(oldsfp);
 	     i < sfp->count;
-	     i++, sfep = xfs_dir3_sf_nextentry(dp->i_mount, sfp, sfep),
-		  oldsfep = xfs_dir3_sf_nextentry(dp->i_mount, oldsfp, oldsfep)) {
+	     i++, sfep = xfs_dir3_sf_nextentry(mp, sfp, sfep),
+		  oldsfep = xfs_dir3_sf_nextentry(mp, oldsfp, oldsfep)) {
 		sfep->namelen = oldsfep->namelen;
 		sfep->offset = oldsfep->offset;
 		memcpy(sfep->name, oldsfep->name, sfep->namelen);
-		xfs_dir3_sfe_put_ino(dp->i_mount, sfp, sfep,
-			xfs_dir3_sfe_get_ino(dp->i_mount, oldsfp, oldsfep));
+		xfs_dir3_sfe_put_ino(mp, sfp, sfep,
+			xfs_dir3_sfe_get_ino(mp, oldsfp, oldsfep));
+		xfs_dir3_sfe_put_ftype(mp, sfp, sfep,
+			xfs_dir3_sfe_get_ftype(mp, oldsfp, oldsfep));
 	}
 	/*
 	 * Clean up the inode.
fs/xfs/xfs_sb.h +2 -1
index c5b1c04..4851137 100644
@@ -594,7 +594,8 @@ xfs_sb_has_ro_compat_feature(
 }
 
 #define XFS_SB_FEAT_INCOMPAT_FTYPE	(1 << 0)	/* filetype in dirent */
-#define XFS_SB_FEAT_INCOMPAT_ALL 0
+#define XFS_SB_FEAT_INCOMPAT_ALL \
+		(XFS_SB_FEAT_INCOMPAT_FTYPE)
 
 #define XFS_SB_FEAT_INCOMPAT_UNKNOWN	~XFS_SB_FEAT_INCOMPAT_ALL
 static inline bool
Signature · 6 lines
1.8.3.2

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#154 lore raw
In reply to Dave Chinner
Quoted 4 lines · Dave Chinner

Hi folks,

The following mass of patches is my current patch queue I have pending for the 3.12 cycle.

OK, it seems to be going okay: The PC is still functioning, even on a CRC-enabled / partition. The git am session had these anomalies:

# Patch #5
Applying: xfs: separate dquot on disk format definitions out of xfs_quota.h /usr/src/kernel-git/linux/.git/rebase-apply/patch:138: trailing whitespace.
* This header file defines all the on-disk format definitions for
warning: 1 line adds whitespace errors.

# Patch #15
Applying: xfs: move getdents code into it's own file /usr/src/kernel-git/linux/.git/rebase-apply/patch:1266: new blank line at EOF. +
warning: 1 line adds whitespace errors.

########
There were build errors as well with gcc-4.8.1:

CC fs/xfs/xfs_inode_fork.o
fs/xfs/xfs_inode_fork.c:43:23: fatal error: xfs_utils.h: No such file or directory

 #include "xfs_utils.h"
                       ^

compilation terminated.
make[2]: *** [fs/xfs/xfs_inode_fork.o] Error 1
make[1]: *** [fs/xfs] Error 2
make: *** [fs] Error 2

# next try...
  CC      fs/xfs/xfs_inode_fork.o
fs/xfs/xfs_inode_fork.c:49:26: fatal error: xfs_vnodeops.h: No such file or directory
 #include "xfs_vnodeops.h"
                          ^
compilation terminated.
make[2]: *** [fs/xfs/xfs_inode_fork.o] Error 1
make[1]: *** [fs/xfs] Error 2
make: *** [fs] Error 2

########
Hopefully, I didn't leave a patch out. To get the code to build fully, these patches were applied:

fs/xfs/xfs_inode_fork.c +0 -2
index f06570b..123971b 100644
@@ -40,10 +40,8 @@
 #include "xfs_ialloc.h"
 #include "xfs_bmap.h"
 #include "xfs_error.h"
-#include "xfs_utils.h"
 #include "xfs_quota.h"
 #include "xfs_filestream.h"
-#include "xfs_vnodeops.h"
 #include "xfs_cksum.h"
 #include "xfs_trace.h"
 #include "xfs_icache.h"
Signature · 1 line
1.8.3.2
fs/xfs/xfs_log_rlimit.c +2 -1
index e3f4b4e..9224296 100644
@@ -137,7 +137,8 @@ xfs_log_calc_minimum_size(
 	 * it up to lsunit boundary if lsunit is specified.
 	 */
 	if (lsunit)
-		min_logblks = roundup(BTOBB(max_logres), lsunit) + 2 * lsunit;
+		min_logblks = roundup((int)BTOBB(max_logres), lsunit) 
+			+ 2 * lsunit;
 	else
 		min_logblks = BTOBB(max_logres);
 	min_logblks *= XFS_MIN_LOG_FACTOR;
Signature · 14 lines
1.8.3.2

That's about all, so far.  There's something going wrong with a 2k 
non-CRC XFS filesystem that I should track before doing too much with 
xfstests.  The initial results on a 32-bit Pentium 4 looked promising.

Thanks!

Michael

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#155 lore raw
Quoted 28 lines · Michael L. Semon
Quoted 4 lines · Dave Chinner

Hi folks,

The following mass of patches is my current patch queue I have pending for the 3.12 cycle.

OK, it seems to be going okay: The PC is still functioning, even on a CRC-enabled / partition. The git am session had these anomalies:

# Patch #5
Applying: xfs: separate dquot on disk format definitions out of xfs_quota.h /usr/src/kernel-git/linux/.git/rebase-apply/patch:138: trailing whitespace.
* This header file defines all the on-disk format definitions for
warning: 1 line adds whitespace errors.

# Patch #15
Applying: xfs: move getdents code into it's own file /usr/src/kernel-git/linux/.git/rebase-apply/patch:1266: new blank line at EOF. +
warning: 1 line adds whitespace errors.

########
There were build errors as well with gcc-4.8.1:

CC fs/xfs/xfs_inode_fork.o
fs/xfs/xfs_inode_fork.c:43:23: fatal error: xfs_utils.h: No such file or directory

 #include "xfs_utils.h"
                       ^
Quoted 8 lines

compilation terminated.
make[2]: *** [fs/xfs/xfs_inode_fork.o] Error 1
make[1]: *** [fs/xfs] Error 2
make: *** [fs] Error 2

# next try...
  CC      fs/xfs/xfs_inode_fork.o
fs/xfs/xfs_inode_fork.c:49:26: fatal error: xfs_vnodeops.h: No such file or directory
 #include "xfs_vnodeops.h"

Ah, I thought I caught all of them. I use a rsync'd build tree, and I don't use --delete because that removes all the object files. Hence sometimes I end up with "stale files" that have been removed from the source tree but don't get removed from the build tree and so the build doesn't fail.

(I thought I added a "git clean -f -d" to my build script, but on review, that only went into the userspace builds....)

fs/xfs/xfs_log_rlimit.c xfs_log_calc_minimum_size( · line 141

Quoted 9 lines
fs/xfs/xfs_log_rlimit.c +2 -1
@@ -137,7 +137,8 @@ xfs_log_calc_minimum_size(
 	 * it up to lsunit boundary if lsunit is specified.
 	 */
 	if (lsunit)
-		min_logblks = roundup(BTOBB(max_logres), lsunit) + 2 * lsunit;
+		min_logblks = roundup((int)BTOBB(max_logres), lsunit) 
+			+ 2 * lsunit;

Why did you need that one change?

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#156 lore raw
Quoted 38 lines · Dave Chinner
Quoted 28 lines · Michael L. Semon
Quoted 4 lines · Dave Chinner

Hi folks,

The following mass of patches is my current patch queue I have pending for the 3.12 cycle.

OK, it seems to be going okay: The PC is still functioning, even on a CRC-enabled / partition. The git am session had these anomalies:

# Patch #5
Applying: xfs: separate dquot on disk format definitions out of xfs_quota.h /usr/src/kernel-git/linux/.git/rebase-apply/patch:138: trailing whitespace.
* This header file defines all the on-disk format definitions for
warning: 1 line adds whitespace errors.

# Patch #15
Applying: xfs: move getdents code into it's own file /usr/src/kernel-git/linux/.git/rebase-apply/patch:1266: new blank line at EOF. +
warning: 1 line adds whitespace errors.

########
There were build errors as well with gcc-4.8.1:

CC fs/xfs/xfs_inode_fork.o
fs/xfs/xfs_inode_fork.c:43:23: fatal error: xfs_utils.h: No such file or directory

 #include "xfs_utils.h"
                       ^
Quoted 8 lines

compilation terminated.
make[2]: *** [fs/xfs/xfs_inode_fork.o] Error 1
make[1]: *** [fs/xfs] Error 2
make: *** [fs] Error 2

# next try...
  CC      fs/xfs/xfs_inode_fork.o
fs/xfs/xfs_inode_fork.c:49:26: fatal error: xfs_vnodeops.h: No such file or directory
 #include "xfs_vnodeops.h"
Quoted 8 lines

Ah, I thought I caught all of them. I use a rsync'd build tree, and I don't use --delete because that removes all the object files. Hence sometimes I end up with "stale files" that have been removed from the source tree but don't get removed from the build tree and so the build doesn't fail.

(I thought I added a "git clean -f -d" to my build script, but on review, that only went into the userspace builds....)

This was a breeze, anyway. Good work!

Quoted 11 lines

fs/xfs/xfs_log_rlimit.c xfs_log_calc_minimum_size( · line 141

Quoted 9 lines
fs/xfs/xfs_log_rlimit.c +2 -1
@@ -137,7 +137,8 @@ xfs_log_calc_minimum_size(
       * it up to lsunit boundary if lsunit is specified.
       */
      if (lsunit)
-             min_logblks = roundup(BTOBB(max_logres), lsunit) + 2 * lsunit;
+             min_logblks = roundup((int)BTOBB(max_logres), lsunit)
+                     + 2 * lsunit;

Why did you need that one change?

This fixes a build error with gcc-4.8.1 to do with the roundup() function and calling something like __divdi3. The code compiles without the cast, but without the cast, one of the final kernel link stages fails. include/linux/kernel.h from the kernel source mentioned something about it for gcc-3.3 needing a workaround. I came up with a (const int) cast to kludge xfs_log_rlimit.c. [Without the kernel comments, I wouldn't have found the answer on my own.] Jeff reduced it to just (int), and it works, but I never got his final answer on whether it was the best solution.

Should somebody else come across the same issue with gcc-4.8.1--especially on something other than 32-bit x86--I'll push this idea with more confidence.

Sorry for the omitted explanation!

Michael

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

#157 lore raw
In reply to Dave Chinner

Hey Dave,

We missed you on the call today. We discussed 3.12 content:

This series remains the primary focus for 3.12. Mark has completed the review of the 3.12 kernel work, and sent a couple patches related to patches 44 and 46 of this series to you via private email. It sounds like there are still a couple of issues that need to be addressed and this doesn't apply starting around patch 14. Sounds like if you resolve that and repost we can start pulling this series in...

Mark has moved on to reviewing the most recent xfsprogs series for the libxfs sync.

I am still working on review of the crc-dev series, and will be pulling them into the master branch as my concerns are addressed. No objection to adding patches on the end, I just need to match them up with the issues they address. I'll probably try to resolve some of them myself once I'm through my first pass of review.

We'll be holding off on Eric's recent posts as well as Dwight and Zhi's work until after all three series have been committed. If someone objects we'll have that conversation.

Chandra has posted some quota related work that would be nice to have in xfsprogs for the release. He may need to rebase after we pull your work in.

That's about it. I'll post my notes from the meeting on the xfs.org wiki.

Regards,
Ben

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