From patchwork Thu Mar 29 08:23:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Misono Tomohiro X-Patchwork-Id: 10314729 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BEB606055B for ; Thu, 29 Mar 2018 08:23:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC7322A238 for ; Thu, 29 Mar 2018 08:23:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A0FC72A23C; Thu, 29 Mar 2018 08:23:52 +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=-6.9 required=2.0 tests=BAYES_00,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 20AEC2A238 for ; Thu, 29 Mar 2018 08:23:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752048AbeC2IXt (ORCPT ); Thu, 29 Mar 2018 04:23:49 -0400 Received: from mgwym01.jp.fujitsu.com ([211.128.242.40]:28102 "EHLO mgwym01.jp.fujitsu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751070AbeC2IXt (ORCPT ); Thu, 29 Mar 2018 04:23:49 -0400 Received: from yt-mxoi2.gw.nic.fujitsu.com (unknown [192.168.229.69]) by mgwym01.jp.fujitsu.com with smtp id 37bc_3b66_1c2981a7_f349_493d_a3a8_358d6356f043; Thu, 29 Mar 2018 17:23:43 +0900 Received: from g01jpfmpwyt02.exch.g01.fujitsu.local (g01jpfmpwyt02.exch.g01.fujitsu.local [10.128.193.56]) by yt-mxoi2.gw.nic.fujitsu.com (Postfix) with ESMTP id EAB87AC00EC for ; Thu, 29 Mar 2018 17:23:42 +0900 (JST) Received: from g01jpexchyt38.g01.fujitsu.local (unknown [10.128.193.4]) by g01jpfmpwyt02.exch.g01.fujitsu.local (Postfix) with ESMTP id 325DB58426C for ; Thu, 29 Mar 2018 17:23:42 +0900 (JST) X-SecurityPolicyCheck: OK by SHieldMailChecker v2.5.2 X-SHieldMailCheckerPolicyVersion: FJ-ISEC-20170217-enc X-SHieldMailCheckerMailID: 89ad433ad2ef4b43bc675249554fd619 Subject: [PATCH v2 3/3] btrfs-progs: fi usage: cleanup unnecessary permission error check From: Misono Tomohiro To: linux-btrfs References: <99d3f3bf-ecc3-b6f5-c38c-8fba83db48d0@jp.fujitsu.com> Message-ID: Date: Thu, 29 Mar 2018 17:23:39 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <99d3f3bf-ecc3-b6f5-c38c-8fba83db48d0@jp.fujitsu.com> Content-Language: en-US X-SecurityPolicyCheck-GC: OK by FENCE-Mail X-TM-AS-MML: disable Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since BTRFS_IOC_FS_INFO does not require root privilege, there is no need to check EPERM error. Reviewed-by: Qu Wenruo Signed-off-by: Tomohiro Misono --- cmds-fi-usage.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/cmds-fi-usage.c b/cmds-fi-usage.c index 2d45b3bb..5ce87a37 100644 --- a/cmds-fi-usage.c +++ b/cmds-fi-usage.c @@ -549,8 +549,6 @@ static int load_device_info(int fd, struct device_info **device_info_ptr, ret = ioctl(fd, BTRFS_IOC_FS_INFO, &fi_args); if (ret < 0) { - if (errno == EPERM) - return -errno; error("cannot get filesystem info: %m"); return 1; } @@ -635,11 +633,6 @@ int load_chunk_and_device_info(int fd, struct chunk_info **chunkinfo, } ret = load_device_info(fd, devinfo, devcount); - if (ret == -EPERM) { - warning( - "cannot get filesystem info from ioctl(FS_INFO), run as root"); - ret = 0; - } return ret; }