Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1813954imm; Thu, 23 Aug 2018 09:09:36 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxgukNsHgWUMzCfVJeXverwHcnE4mPzaj3405Tr0JeKkta2S4OL2cliT7ZJnPDD+wiMUeft X-Received: by 2002:a17:902:42c3:: with SMTP id h61-v6mr35640869pld.319.1535040576525; Thu, 23 Aug 2018 09:09:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535040576; cv=none; d=google.com; s=arc-20160816; b=l0+/DgiEGU9xBb3PK5DTJAcFvRBmvVKpxS8enOH6NUjPc4DMXaS3LLMFRyAPBKKE+1 yM6ftJd8/Go2sCJ/xQMyHFTzGBsXbOWaoG61O7c6WMgeFanWRJZQtKh/+0+Cc4BSbAFh qDft9Dj2bx1ONjpFLIc79vbQidqhQaaP3kdbiA0MBNpgpMmnwWWujPJ/oEaQ5hOTOSIu WZAKIKpD5/4u9Auodj54MhEooQl8pQPd5jYAvnR3M4+rhUaSZlEQP15ulIn3mYZPQSaP u5EhzxxbeNT8oQObXh47ZxKjjZg4qy0yhPvLP+ryy5csCSZ/prJb5piG5+wxICBK5MrI fNSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=HeEeMRF6A3CsneEv3S8FiMZWnAYYVzsRIrjvUQkVHiU=; b=f0iuGxnLJ0IarZHhyApebEr+ZAUHidjQpH8ubpJQjBiNRFQregn0eBIPV5JuJ2XJyD 6fZ6qSuNVrznD4yEVgifFUftLGk+dG/269RR6Tzb0f/CvGPxbGpaHmoRHLZMs8wvssMr 8tcynKWREIrs21i5BZzODebzpQpVZ2V2wPkVYyMdQvG03nkfJEwsC/FA9qG8miyVpRIO cZb6MoUd2BUIYSJSnQJrAoLYltTN8xRh6uvPOyXFo3qZBd7cxMUdFWtVZT4/2uI4iexG Sta5ilzl/nndVrfEcRqawcK9YgpBz5KqEXsjkY4Dno96IUAPXoxlkLoEmgUyG+8x0VZX jgvg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t10-v6si4487850ply.181.2018.08.23.09.09.20; Thu, 23 Aug 2018 09:09:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731153AbeHWOnJ (ORCPT + 99 others); Thu, 23 Aug 2018 10:43:09 -0400 Received: from mx2.suse.de ([195.135.220.15]:58842 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726360AbeHWOnJ (ORCPT ); Thu, 23 Aug 2018 10:43:09 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id E1A08AE69; Thu, 23 Aug 2018 11:13:55 +0000 (UTC) Date: Thu, 23 Aug 2018 13:13:55 +0200 From: Michal Hocko To: Weikang Shi Cc: akpm@linux-foundation.org, alexander.h.duyck@intel.com, vbabka@suse.cz, mgorman@suse.de, l.stach@pengutronix.de, vdavydov.dev@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, my_email@gmail.com Subject: Re: [PATCH] fs: fix local var type Message-ID: <20180823111355.GD29735@dhcp22.suse.cz> References: <1535014754-31918-1-git-send-email-swkhack@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1535014754-31918-1-git-send-email-swkhack@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 23-08-18 01:59:14, Weikang Shi wrote: > In the seq_hex_dump function,the remaining variable is int, but it receive a type of size_t argument. > So I change the type of remaining The changelog should explain _why_ we need this fix. Is any of the code path overflowing? Besides that I do not think this fix is complete. What about linelen? Why do we even need len to be size_t? Why it cannot be int as well. I strongly doubt we need more than 32b here. > Signed-off-by: Weikang Shi > --- > fs/seq_file.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/fs/seq_file.c b/fs/seq_file.c > index 1dea7a8..d0e8bec 100644 > --- a/fs/seq_file.c > +++ b/fs/seq_file.c > @@ -847,7 +847,8 @@ void seq_hex_dump(struct seq_file *m, const char *prefix_str, int prefix_type, > bool ascii) > { > const u8 *ptr = buf; > - int i, linelen, remaining = len; > + int i, linelen; > + size_t remaining = len; > char *buffer; > size_t size; > int ret; > -- > 2.7.4 > -- Michal Hocko SUSE Labs