Thread (38 messages) 38 messages, 1 author, 2021-02-18
STALE1971d REVIEWED: 6 (4M)
Revisions (4)
  1. v12 [diff vs current]
  2. v13 [diff vs current]
  3. v14 [diff vs current]
  4. v15 current

[PATCH v15 09/37] xfsprogs: Check for extent overflow when writing to unwritten extent

From: Allison Henderson <hidden>
Date: 2021-02-18 18:46:34
Subsystem: the rest · Maintainer: Linus Torvalds

From: Chandan Babu R <redacted>

Source kernel commit: c442f3086d5a108b7ff086c8ade1923a8f389db5

A write to a sub-interval of an existing unwritten extent causes
the original extent to be split into 3 extents
i.e. | Unwritten | Real | Unwritten |
Hence extent count can increase by 2.

Reviewed-by: Darrick J. Wong <redacted>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Allison Henderson <redacted>
Signed-off-by: Chandan Babu R <redacted>
Signed-off-by: Darrick J. Wong <redacted>
Signed-off-by: Allison Henderson <redacted>
---
 libxfs/xfs_inode_fork.h | 9 +++++++++
 1 file changed, 9 insertions(+)
diff --git a/libxfs/xfs_inode_fork.h b/libxfs/xfs_inode_fork.h
index 8d89838..917e289 100644
--- a/libxfs/xfs_inode_fork.h
+++ b/libxfs/xfs_inode_fork.h
@@ -71,6 +71,15 @@ struct xfs_ifork {
 	(XFS_DA_NODE_MAXDEPTH + max(1, rmt_blks))
 
 /*
+ * A write to a sub-interval of an existing unwritten extent causes the original
+ * extent to be split into 3 extents
+ * i.e. | Unwritten | Real | Unwritten |
+ * Hence extent count can increase by 2.
+ */
+#define XFS_IEXT_WRITE_UNWRITTEN_CNT	(2)
+
+
+/*
  * Fork handling.
  */
 
-- 
2.7.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help