linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [2.6.35-rc6 patch] correct item insert accounting...
@ 2010-07-23 22:46 Daniel J Blueman
  0 siblings, 0 replies; only message in thread
From: Daniel J Blueman @ 2010-07-23 22:46 UTC (permalink / raw)
  To: Chris Mason; +Cc: Linux BTRFS

Hi Chris,

It looks like this was the intent - if not, perhaps drop the redundant
'nr = i' assignment?

---

Limit the number of items to insert (nr) to the available space in the BTRFS
leaf as intended.

Signed-off-by: Daniel J Blueman <daniel.blueman@gmail.com>

diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index c3df14c..fb7e20d 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -3544,8 +3544,8 @@ int btrfs_insert_some_items(struct
btrfs_trans_handle *trans,
 	for (i = 0; i < nr; i++) {
 		if (total_size + data_size[i] + sizeof(struct btrfs_item) >
 		    BTRFS_LEAF_DATA_SIZE(root)) {
-			break;
 			nr = i;
+			break;
 		}
 		total_data += data_size[i];
 		total_size += data_size[i] + sizeof(struct btrfs_item);
-- 
Daniel J Blueman

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-07-23 22:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-23 22:46 [2.6.35-rc6 patch] correct item insert accounting Daniel J Blueman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).