From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 In-Reply-To: <20171005230633.GK21978@ZenIV.linux.org.uk> References: <20171005183636.20732-1-sergey.m.klyaus@gmail.com> <20171005205724.GJ21978@ZenIV.linux.org.uk> <20171005230633.GK21978@ZenIV.linux.org.uk> From: Linus Torvalds Date: Thu, 5 Oct 2017 18:31:29 -0700 Message-ID: Subject: Re: [PATCH] vfs: fix statfs64() returning impossible EOVERFLOW for 64-bit f_files To: Al Viro Cc: Sergey Klyaus , linux-fsdevel , Linux Kernel Mailing List , Li Wang , Andreas Dilger , Andi Kleen Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: On Thu, Oct 5, 2017 at 4:06 PM, Al Viro wrote: > > Just to make sure we are on the same page: out of kstatfs fields > we have 5 u64 ones (see above; all of them are u64 is struct statfs64 > on all architectures), an opaque 64bit f_fsid and 5 fields that > are long: f_type (magic numbers, all 32bit), f_namelen (max filename > length), f_frsize (0 on most of filesystems, always fits into 32 bits), > f_flags (guaranteed to be 32bit) and f_bsize. Please just use that FITS_IN() kind of macro regardless. If the sizes match, the compiler will optimize the test away. If the sizes don't match, that FITS_IN() will do the right thing. Do *not* manually go and say "these fields are ok, because..". The whole bug was because people were confused about the field widths. Linus