From patchwork Tue May 13 02:22:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ZhangZhen X-Patchwork-Id: 4162121 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 76597BFF02 for ; Tue, 13 May 2014 02:23:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7D10E2021B for ; Tue, 13 May 2014 02:23:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 82D7020218 for ; Tue, 13 May 2014 02:23:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752218AbaEMCXi (ORCPT ); Mon, 12 May 2014 22:23:38 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:36090 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751729AbaEMCXh (ORCPT ); Mon, 12 May 2014 22:23:37 -0400 Received: from 172.24.2.119 (EHLO szxeml211-edg.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id AOO84275; Tue, 13 May 2014 10:23:32 +0800 (CST) Received: from SZXEML410-HUB.china.huawei.com (10.82.67.137) by szxeml211-edg.china.huawei.com (172.24.2.182) with Microsoft SMTP Server (TLS) id 14.3.158.1; Tue, 13 May 2014 10:22:23 +0800 Received: from [127.0.0.1] (10.111.69.77) by szxeml410-hub.china.huawei.com (10.82.67.137) with Microsoft SMTP Server id 14.3.158.1; Tue, 13 May 2014 10:22:21 +0800 Message-ID: <537181DB.2010400@huawei.com> Date: Tue, 13 May 2014 10:22:19 +0800 From: Zhang Zhen User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: , , David Taylor CC: linux-btrfs Subject: [PATCH] btrfs: replace simple_strtoul() with kstrtoul() References: <1399947478-11287-1-git-send-email-zhenzhang.zhang@huawei.com> In-Reply-To: <1399947478-11287-1-git-send-email-zhenzhang.zhang@huawei.com> X-Forwarded-Message-Id: <1399947478-11287-1-git-send-email-zhenzhang.zhang@huawei.com> X-Originating-IP: [10.111.69.77] X-CFilter-Loop: Reflected Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP use the newer and more pleasant kstrtoul() to replace simple_strtoul(), because simple_strtoul() is marked for obsoletion. Signed-off-by: Zhang Zhen --- fs/btrfs/ioctl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 2ad7de9..30bcc47 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -1502,11 +1502,12 @@ static noinline int btrfs_ioctl_resize(struct file *file, sizestr = vol_args->name; devstr = strchr(sizestr, ':'); if (devstr) { - char *end; sizestr = devstr + 1; *devstr = '\0'; devstr = vol_args->name; - devid = simple_strtoull(devstr, &end, 10); + ret = kstrtoul(devstr, 10, &devid); + if (ret) + goto out_free; if (!devid) { ret = -EINVAL; goto out_free;