From patchwork Thu Nov 1 09:30:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rock Lee X-Patchwork-Id: 1683641 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 93E2CE00A6 for ; Thu, 1 Nov 2012 09:31:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757363Ab2KAJbA (ORCPT ); Thu, 1 Nov 2012 05:31:00 -0400 Received: from mail-vc0-f174.google.com ([209.85.220.174]:54064 "EHLO mail-vc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752361Ab2KAJa5 (ORCPT ); Thu, 1 Nov 2012 05:30:57 -0400 Received: by mail-vc0-f174.google.com with SMTP id fk26so2436633vcb.19 for ; Thu, 01 Nov 2012 02:30:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=rkSi9rmM+mM9y3NB1N1PoxuGU838ZlXtic8VNZOjMQ8=; b=kA34/q3Six8eVbR4zYM9YpN6P7Yj1dlLz+O/YmhLuquDPQj81dPSC7wZ7UQXjQadds ot+02PUVPGfUbSbAUtUK/k55P5C3QJP/wOTeJBB/9oniB922gCkjPToHkQHn+hNBB1u3 3BySGTE4y6eSUgSVw2HzpJxacnZtNgjhr3IvlmymqXxzP2q5gP18zTRBAucdcHLHWgmh 3tCFcwRuH5iMlkmQSX9E7SntqfWYIwJj8GfBqrwdiRVGl5vfuZzPuzhraFJZ/ooGChvT vNbGv4umCC5b630+55S7VGD4JtVhoanzvTTOw641HFSW4KGAyp4EgpzQ2GPPZJBxtSTN +MAg== MIME-Version: 1.0 Received: by 10.52.68.226 with SMTP id z2mr50253704vdt.76.1351762256379; Thu, 01 Nov 2012 02:30:56 -0700 (PDT) Received: by 10.59.6.226 with HTTP; Thu, 1 Nov 2012 02:30:56 -0700 (PDT) Date: Thu, 1 Nov 2012 17:30:56 +0800 Message-ID: Subject: [PATCH] shared compression workspaces limits doesnot match From: Rock Lee To: linux-btrfs@vger.kernel.org Cc: Rock Lee Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org In function find_workspace, it's allowed to alloc cpus + 1 workspaces at most, but in function free_workspace, it will freed the workspace if there exists more then cpus' workspaces. The two limits doesn't match. I thought the original itention is allowed to alloc cpus compression workspaces at most. Signed-off-by: Rock Lee --- fs/btrfs/compression.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) -- 1.7.7.6 -- 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 diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index c6467aa..eef1811 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c @@ -779,7 +779,7 @@ again: return workspace; } - if (atomic_read(alloc_workspace) > cpus) { + if (atomic_read(alloc_workspace) >= cpus) { DEFINE_WAIT(wait); spin_unlock(workspace_lock);