From patchwork Thu Jan 31 20:20:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 10791403 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2B70E13B4 for ; Thu, 31 Jan 2019 20:21:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2302B3188C for ; Thu, 31 Jan 2019 20:21:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1749A31890; Thu, 31 Jan 2019 20:21:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB9133188C for ; Thu, 31 Jan 2019 20:20:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727725AbfAaUU7 (ORCPT ); Thu, 31 Jan 2019 15:20:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55184 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727714AbfAaUU7 (ORCPT ); Thu, 31 Jan 2019 15:20:59 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2E4D7DC91F for ; Thu, 31 Jan 2019 20:20:59 +0000 (UTC) Received: from [IPv6:::1] (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EA9FA608E5 for ; Thu, 31 Jan 2019 20:20:58 +0000 (UTC) To: linux-xfs From: Eric Sandeen Subject: [PATCH] xfs_repair: fix incorrect return value in namecheck() Message-ID: Date: Thu, 31 Jan 2019 14:20:58 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 31 Jan 2019 20:20:59 +0000 (UTC) Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Obviously a directory entry with a '/' in the name should return 1, i.e. failure. This was just a dumb thinko. Fixes: 45571fd5885d ("xfs_repair: allow '/' in attribute names") Reported-by: Darrick J. Wong Signed-off-by: Eric Sandeen Reviewed-by: Darrick J. Wong Reviewed-by: Bill O'Donnell diff --git a/repair/da_util.c b/repair/da_util.c index c5e690c..4a258e5 100644 --- a/repair/da_util.c +++ b/repair/da_util.c @@ -31,7 +31,7 @@ namecheck( for (c = name, i = 0; i < length; i++, c++) { if (isadir && *c == '/') - return 0; + return 1; if (*c == '\0') return 1; }