From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f68.google.com ([209.85.221.68]:40939 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726267AbeJXWBe (ORCPT ); Wed, 24 Oct 2018 18:01:34 -0400 Received: by mail-wr1-f68.google.com with SMTP id d2-v6so5621006wro.7 for ; Wed, 24 Oct 2018 06:33:24 -0700 (PDT) Date: Wed, 24 Oct 2018 14:33:21 +0100 From: Phillip Potter To: Al Viro Cc: amir73il@gmail.com, linux-fsdevel@vger.kernel.org Subject: Re: [RFC][PATCH v3 01/10] fs: common implementation of file type Message-ID: <20181024133321.GC23398@pathfinder> References: <20181023201953.GA15687@pathfinder> <20181024123740.GA32577@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181024123740.GA32577@ZenIV.linux.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Oct 24, 2018 at 01:37:40PM +0100, Al Viro wrote: > On Tue, Oct 23, 2018 at 09:19:53PM +0100, Phillip Potter wrote: > > > +static inline unsigned char fs_dtype(int filetype) > > That "int" is asking for trouble, especially since negative > argument will blow up. And it comes from untrusted source... > > > +{ > > + if (filetype >= FT_MAX) > > + return DT_UNKNOWN; > > + > > + return fs_dtype_by_ftype[filetype]; > > +} Dear Al, Thank you, good point, I will change to unsigned int and republish as part of new series. Regards, Phil