From patchwork Mon Mar 4 22:49:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 2215171 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 5B5B4DF2F2 for ; Mon, 4 Mar 2013 22:49:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932490Ab3CDWtl (ORCPT ); Mon, 4 Mar 2013 17:49:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46774 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932336Ab3CDWtl (ORCPT ); Mon, 4 Mar 2013 17:49:41 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r24MnfFX004499 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 4 Mar 2013 17:49:41 -0500 Received: from liberator.sandeen.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r24Mnexo025581 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Mon, 4 Mar 2013 17:49:41 -0500 Message-ID: <51352504.7040104@redhat.com> Date: Mon, 04 Mar 2013 16:49:40 -0600 From: Eric Sandeen User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130216 Thunderbird/17.0.3 MIME-Version: 1.0 To: linux-btrfs@vger.kernel.org Subject: [PATCH 15/14] btrfs-progs: fix scrub error return from pthread_mutex_lock References: <1362436804-16766-1-git-send-email-sandeen@redhat.com> In-Reply-To: <1362436804-16766-1-git-send-email-sandeen@redhat.com> X-Enigmail-Version: 1.5.1 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org If pthread_mutex_lock() fails it returns the error in ret, and does not set errno. Signed-off-by: Eric Sandeen --- -- 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/cmds-scrub.c b/cmds-scrub.c index f73b3c6..8129601 100644 --- a/cmds-scrub.c +++ b/cmds-scrub.c @@ -763,7 +763,7 @@ static int scrub_write_progress(pthread_mutex_t *m, const char *fsid, ret = pthread_mutex_lock(m); if (ret) { - err = -errno; + err = -ret; goto out; }