Fix control flow to store count before breaking loop.
Signed-off-by: Daniel J Blueman <daniel@quora.org>
---
fs/btrfs/ctree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index e801f22..2227420 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -3465,8 +3465,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);
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs"
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
On Thu, May 03, 2012 at 09:44:49PM +0800, Daniel J Blueman wrote:> Fix control flow to store count before breaking loop.http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg10483.html but it''s a dead code anyway. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 3 May 2012 22:04, David Sterba <dave@jikos.cz> wrote:> On Thu, May 03, 2012 at 09:44:49PM +0800, Daniel J Blueman wrote: >> Fix control flow to store count before breaking loop. > > http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg10483.html > but it''s a dead code anyway.Noted. Chris, is it a good time to take out btrfs_insert_some_items or, if keeping it, apply David''s patch to avoid related surprises? Thanks, Daniel -- Daniel J Blueman -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html