Re: [PATCH] fs/befs/linuxvfs.c: need signed cast for variable 'block'

2013-11-03 Thread Chen Gang
On 11/03/2013 12:27 AM, Al Viro wrote: > On Sat, Nov 02, 2013 at 08:44:46AM -0700, Greg KH wrote: > >>> Oh, for me, it is not suitable to move a file system sub-directory to >>> "drivers/*/" sub-directory. And I can not find any sub-directory like >>> 'staging' under "fs" sub-directory, either. >>

Re: [PATCH] fs/befs/linuxvfs.c: need signed cast for variable 'block'

2013-11-02 Thread Al Viro
On Sat, Nov 02, 2013 at 08:44:46AM -0700, Greg KH wrote: > > Oh, for me, it is not suitable to move a file system sub-directory to > > "drivers/*/" sub-directory. And I can not find any sub-directory like > > 'staging' under "fs" sub-directory, either. > > > > Do we have any sub-directory like "s

Re: [PATCH] fs/befs/linuxvfs.c: need signed cast for variable 'block'

2013-11-02 Thread Greg KH
On Sat, Nov 02, 2013 at 09:46:31PM +0800, Chen Gang wrote: > On 11/01/2013 10:41 AM, Chen Gang wrote: > > On 11/01/2013 04:45 AM, Greg KH wrote: > >> On Thu, Oct 31, 2013 at 12:08:33PM -0700, Kees Cook wrote: > >>> On Thu, Oct 31, 2013 at 12:06 PM, Al Viro wrote: > On Thu, Oct 31, 2013 at 09:

Re: [PATCH] fs/befs/linuxvfs.c: need signed cast for variable 'block'

2013-11-02 Thread Chen Gang
On 11/01/2013 10:41 AM, Chen Gang wrote: > On 11/01/2013 04:45 AM, Greg KH wrote: >> On Thu, Oct 31, 2013 at 12:08:33PM -0700, Kees Cook wrote: >>> On Thu, Oct 31, 2013 at 12:06 PM, Al Viro wrote: On Thu, Oct 31, 2013 at 09:53:59AM -0700, Kees Cook wrote: > If block (type sector_t) i

Re: [PATCH] fs/befs/linuxvfs.c: need signed cast for variable 'block'

2013-10-31 Thread Chen Gang
On 11/01/2013 04:45 AM, Greg KH wrote: > On Thu, Oct 31, 2013 at 12:08:33PM -0700, Kees Cook wrote: >> On Thu, Oct 31, 2013 at 12:06 PM, Al Viro wrote: >>> On Thu, Oct 31, 2013 at 09:53:59AM -0700, Kees Cook wrote: >>> If block (type sector_t) is unsigned, we shouldn't cast it signed. Th

Re: [PATCH] fs/befs/linuxvfs.c: need signed cast for variable 'block'

2013-10-31 Thread Greg KH
On Thu, Oct 31, 2013 at 12:08:33PM -0700, Kees Cook wrote: > On Thu, Oct 31, 2013 at 12:06 PM, Al Viro wrote: > > On Thu, Oct 31, 2013 at 09:53:59AM -0700, Kees Cook wrote: > > > >> If block (type sector_t) is unsigned, we shouldn't cast it signed. > >> This entire code path should be removed. Wha

Re: [PATCH] fs/befs/linuxvfs.c: need signed cast for variable 'block'

2013-10-31 Thread Kees Cook
On Thu, Oct 31, 2013 at 12:06 PM, Al Viro wrote: > On Thu, Oct 31, 2013 at 09:53:59AM -0700, Kees Cook wrote: > >> If block (type sector_t) is unsigned, we shouldn't cast it signed. >> This entire code path should be removed. What is BEFS's expected >> maximum block size? (Looks like even befs_blo

Re: [PATCH] fs/befs/linuxvfs.c: need signed cast for variable 'block'

2013-10-31 Thread Al Viro
On Thu, Oct 31, 2013 at 09:53:59AM -0700, Kees Cook wrote: > If block (type sector_t) is unsigned, we shouldn't cast it signed. > This entire code path should be removed. What is BEFS's expected > maximum block size? (Looks like even befs_blocknr_t is u64, so nothing > seems trivially in danger of

Re: [PATCH] fs/befs/linuxvfs.c: need signed cast for variable 'block'

2013-10-31 Thread Kees Cook
On Wed, Oct 30, 2013 at 7:52 PM, Chen Gang wrote: > Need signed cast for it, the original author assume the type of 'block' > is long, so just cast to long. The related warnings (with allmodconfig): > > fs/befs/linuxvfs.c:136:2: warning: comparison of unsigned expression < 0 is > always false [

[PATCH] fs/befs/linuxvfs.c: need signed cast for variable 'block'

2013-10-30 Thread Chen Gang
Need signed cast for it, the original author assume the type of 'block' is long, so just cast to long. The related warnings (with allmodconfig): fs/befs/linuxvfs.c:136:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] Signed-off-by: Chen Gang --- fs/befs/linux