All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: mfasheh@versity.com, akpm@linux-foundation.org,
	jlbec@evilplan.org, darrick.wong@oracle.com
Cc: linux-fsdevel@vger.kernel.org, hch@infradead.org,
	ocfs2-devel@oss.oracle.com
Subject: [PATCH 06/11] ocfs2: budget for extent tree splits when adding refcount flag
Date: Sat, 10 Dec 2016 12:43:34 -0800	[thread overview]
Message-ID: <148140261481.24628.2886096930001337559.stgit@birch.djwong.org> (raw)
In-Reply-To: <148140257493.24628.6724911560073347399.stgit@birch.djwong.org>

When we're adding the refcount flag to an extent, we have to budget
enough space to handle a full extent btree split in addition to
whatever modifications have to be made to the refcount btree.  We
don't currently do this, with the result that generic/186 crashes
when we need an extent split but not a refcount split because meta_ac
never gets allocated.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/ocfs2/refcounttree.c |    3 +++
 1 file changed, 3 insertions(+)


diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c
index 3410eb1..6c98d56 100644
--- a/fs/ocfs2/refcounttree.c
+++ b/fs/ocfs2/refcounttree.c
@@ -3692,6 +3692,9 @@ int ocfs2_add_refcount_flag(struct inode *inode,
 	struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
 	struct ocfs2_alloc_context *meta_ac = NULL;
 
+	/* We need to be able to handle at least an extent tree split. */
+	ref_blocks = ocfs2_extend_meta_needed(data_et->et_root_el);
+
 	ret = ocfs2_calc_refcount_meta_credits(inode->i_sb,
 					       ref_ci, ref_root_bh,
 					       p_cluster, num_clusters,


WARNING: multiple messages have this Message-ID (diff)
From: Darrick J. Wong <darrick.wong@oracle.com>
To: mfasheh@versity.com, akpm@linux-foundation.org,
	jlbec@evilplan.org, darrick.wong@oracle.com
Cc: linux-fsdevel@vger.kernel.org, hch@infradead.org,
	ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 06/11] ocfs2: budget for extent tree splits when adding refcount flag
Date: Sat, 10 Dec 2016 12:43:34 -0800	[thread overview]
Message-ID: <148140261481.24628.2886096930001337559.stgit@birch.djwong.org> (raw)
In-Reply-To: <148140257493.24628.6724911560073347399.stgit@birch.djwong.org>

When we're adding the refcount flag to an extent, we have to budget
enough space to handle a full extent btree split in addition to
whatever modifications have to be made to the refcount btree.  We
don't currently do this, with the result that generic/186 crashes
when we need an extent split but not a refcount split because meta_ac
never gets allocated.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/ocfs2/refcounttree.c |    3 +++
 1 file changed, 3 insertions(+)


diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c
index 3410eb1..6c98d56 100644
--- a/fs/ocfs2/refcounttree.c
+++ b/fs/ocfs2/refcounttree.c
@@ -3692,6 +3692,9 @@ int ocfs2_add_refcount_flag(struct inode *inode,
 	struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
 	struct ocfs2_alloc_context *meta_ac = NULL;
 
+	/* We need to be able to handle at least an extent tree split. */
+	ref_blocks = ocfs2_extend_meta_needed(data_et->et_root_el);
+
 	ret = ocfs2_calc_refcount_meta_credits(inode->i_sb,
 					       ref_ci, ref_root_bh,
 					       p_cluster, num_clusters,

  parent reply	other threads:[~2016-12-10 20:44 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-10 20:42 [PATCH v4 00/11] ocfs2: wire up {clone,copy,dedupe}_range Darrick J. Wong
2016-12-10 20:42 ` [Ocfs2-devel] [PATCH v4 00/11] ocfs2: wire up {clone, copy, dedupe}_range Darrick J. Wong
2016-12-10 20:43 ` [PATCH 01/11] fs: try to clone files first in vfs_copy_file_range Christoph Hellwig
2016-12-10 20:43   ` [Ocfs2-devel] " Christoph Hellwig
2016-12-10 20:43 ` [PATCH 02/11] vfs: refactor clone/dedupe_file_range common functions Darrick J. Wong
2016-12-10 20:43   ` [Ocfs2-devel] " Darrick J. Wong
2016-12-10 20:43 ` [PATCH 03/11] ocfs2: convert inode refcount test to a helper Darrick J. Wong
2016-12-10 20:43   ` [Ocfs2-devel] " Darrick J. Wong
2016-12-10 20:43 ` [PATCH 04/11] ocfs2: add newlines to some error messages Darrick J. Wong
2016-12-10 20:43   ` [Ocfs2-devel] " Darrick J. Wong
2016-12-10 20:43 ` [PATCH 05/11] ocfs2: prohibit refcounted swapfiles Darrick J. Wong
2016-12-10 20:43   ` [Ocfs2-devel] " Darrick J. Wong
2016-12-10 20:43 ` Darrick J. Wong [this message]
2016-12-10 20:43   ` [Ocfs2-devel] [PATCH 06/11] ocfs2: budget for extent tree splits when adding refcount flag Darrick J. Wong
2016-12-10 20:43 ` [PATCH 07/11] ocfs2: don't eat io errors during _dio_end_io_write Darrick J. Wong
2016-12-10 20:43   ` [Ocfs2-devel] " Darrick J. Wong
2016-12-10 20:43 ` [PATCH 08/11] ocfs2: always unlock when completing dio writes Darrick J. Wong
2016-12-10 20:43   ` [Ocfs2-devel] " Darrick J. Wong
2016-12-10 20:43 ` [PATCH 09/11] ocfs2: fix bad pointer cast Darrick J. Wong
2016-12-10 20:43   ` [Ocfs2-devel] " Darrick J. Wong
2016-12-10 20:44 ` [PATCH 10/11] ocfs2: charge quota for reflinked blocks Darrick J. Wong
2016-12-10 20:44   ` [Ocfs2-devel] " Darrick J. Wong
2016-12-10 20:44 ` [PATCH 11/11] ocfs2: implement the VFS clone_range, copy_range, and dedupe_range features Darrick J. Wong
2016-12-10 20:44   ` [Ocfs2-devel] " Darrick J. Wong
2016-12-10 23:43 ` [PATCH v4 00/11] ocfs2: wire up {clone,copy,dedupe}_range Al Viro
2016-12-10 23:43   ` [Ocfs2-devel] [PATCH v4 00/11] ocfs2: wire up {clone, copy, dedupe}_range Al Viro
2016-12-10 23:46   ` [PATCH v4 00/11] ocfs2: wire up {clone,copy,dedupe}_range Al Viro
2016-12-10 23:46     ` [Ocfs2-devel] [PATCH v4 00/11] ocfs2: wire up {clone, copy, dedupe}_range Al Viro
2016-12-11 22:03     ` [PATCH v4 00/11] ocfs2: wire up {clone,copy,dedupe}_range Darrick J. Wong
2016-12-11 22:03       ` [Ocfs2-devel] [PATCH v4 00/11] ocfs2: wire up {clone, copy, dedupe}_range Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=148140261481.24628.2886096930001337559.stgit@birch.djwong.org \
    --to=darrick.wong@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=jlbec@evilplan.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mfasheh@versity.com \
    --cc=ocfs2-devel@oss.oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.