Re: [PATCH] fat: Fix sb_rdonly() change

2017-11-28 Thread Andrew Morton
On Thu, 23 Nov 2017 22:51:34 -0800 Joe Perches  wrote:

> On Fri, 2017-11-24 at 15:07 +0900, OGAWA Hirofumi wrote:
> > Joe Perches  writes:
> > 
> > > On Thu, 2017-11-23 at 15:29 +0900, OGAWA Hirofumi wrote:
> > > > Ouch forgot to add stable@
> > > > 
> > > > -- 
> > > > commit bc98a42c1f7d0f886c0c1b75a92a004976a46d9f introduced bug.
> > > 
> > > I think your commit message needs a bit more information.
> > > 
> > > It'd be useful to describe that the introduction of
> > > sb_rdonly converted the bitwise & to a boolean and so
> > > this conversion and comparison was made defective.
> > > 
> > > Are there any other instances of defective comparisons?
> > 
> > Please ask to that patch author.
> 
> The patch author, David Howells, is on the cc list.
> 
> btw:
> 
> It seems all the the other uses use a (bool) cast of the
> (*flags & MS_RDONLY) and a comparison of sb_rdonly(sb).

Sentence is hard to understand.

> It would make sense to change the argument type of the
> ext[24]_setup_super int read_only arg to bool to match
> the sb_rdonly() type. 

I did this:

: From: OGAWA Hirofumi 
: Subject: fat: Fix sb_rdonly() change
: 
: bc98a42c1f7d0f ("VFS: Convert sb->s_flags & MS_RDONLY to sb_rdonly(sb)")
: converted fat_remount():new_rdonly from a bool to an int.  However
: fat_remount() depends upon the compiler's conversion of a non-zero integer
: into boolean `true'.
: 
: Fix it by switching `new_rdonly' back into a bool.
: 
: Link: http://lkml.kernel.org/r/87mv3d5x51@mail.parknet.co.jp
: Fixes: bc98a42c1f7d0f8 ("VFS: Convert sb->s_flags & MS_RDONLY to 
sb_rdonly(sb)")
: Signed-off-by: OGAWA Hirofumi 
: Cc: Joe Perches 
: Cc: David Howells 
: Cc: 
: Signed-off-by: Andrew Morton 
: ---
: 
:  fs/fat/inode.c |2 +-
:  1 file changed, 1 insertion(+), 1 deletion(-)
: 
: diff -puN fs/fat/inode.c~fat-fix-sb_rdonly-change fs/fat/inode.c
: --- a/fs/fat/inode.c~fat-fix-sb_rdonly-change
: +++ a/fs/fat/inode.c
: @@ -779,7 +779,7 @@ static void __exit fat_destroy_inodecach
:  
:  static int fat_remount(struct super_block *sb, int *flags, char *data)
:  {
: - int new_rdonly;
: + bool new_rdonly;
:   struct msdos_sb_info *sbi = MSDOS_SB(sb);
:   *flags |= SB_NODIRATIME | (sbi->options.isvfat ? 0 : SB_NOATIME);
:  
: _



Re: [PATCH] fat: Fix sb_rdonly() change

2017-11-28 Thread Andrew Morton
On Thu, 23 Nov 2017 22:51:34 -0800 Joe Perches  wrote:

> On Fri, 2017-11-24 at 15:07 +0900, OGAWA Hirofumi wrote:
> > Joe Perches  writes:
> > 
> > > On Thu, 2017-11-23 at 15:29 +0900, OGAWA Hirofumi wrote:
> > > > Ouch forgot to add stable@
> > > > 
> > > > -- 
> > > > commit bc98a42c1f7d0f886c0c1b75a92a004976a46d9f introduced bug.
> > > 
> > > I think your commit message needs a bit more information.
> > > 
> > > It'd be useful to describe that the introduction of
> > > sb_rdonly converted the bitwise & to a boolean and so
> > > this conversion and comparison was made defective.
> > > 
> > > Are there any other instances of defective comparisons?
> > 
> > Please ask to that patch author.
> 
> The patch author, David Howells, is on the cc list.
> 
> btw:
> 
> It seems all the the other uses use a (bool) cast of the
> (*flags & MS_RDONLY) and a comparison of sb_rdonly(sb).

Sentence is hard to understand.

> It would make sense to change the argument type of the
> ext[24]_setup_super int read_only arg to bool to match
> the sb_rdonly() type. 

I did this:

: From: OGAWA Hirofumi 
: Subject: fat: Fix sb_rdonly() change
: 
: bc98a42c1f7d0f ("VFS: Convert sb->s_flags & MS_RDONLY to sb_rdonly(sb)")
: converted fat_remount():new_rdonly from a bool to an int.  However
: fat_remount() depends upon the compiler's conversion of a non-zero integer
: into boolean `true'.
: 
: Fix it by switching `new_rdonly' back into a bool.
: 
: Link: http://lkml.kernel.org/r/87mv3d5x51@mail.parknet.co.jp
: Fixes: bc98a42c1f7d0f8 ("VFS: Convert sb->s_flags & MS_RDONLY to 
sb_rdonly(sb)")
: Signed-off-by: OGAWA Hirofumi 
: Cc: Joe Perches 
: Cc: David Howells 
: Cc: 
: Signed-off-by: Andrew Morton 
: ---
: 
:  fs/fat/inode.c |2 +-
:  1 file changed, 1 insertion(+), 1 deletion(-)
: 
: diff -puN fs/fat/inode.c~fat-fix-sb_rdonly-change fs/fat/inode.c
: --- a/fs/fat/inode.c~fat-fix-sb_rdonly-change
: +++ a/fs/fat/inode.c
: @@ -779,7 +779,7 @@ static void __exit fat_destroy_inodecach
:  
:  static int fat_remount(struct super_block *sb, int *flags, char *data)
:  {
: - int new_rdonly;
: + bool new_rdonly;
:   struct msdos_sb_info *sbi = MSDOS_SB(sb);
:   *flags |= SB_NODIRATIME | (sbi->options.isvfat ? 0 : SB_NOATIME);
:  
: _



Re: [PATCH] fat: Fix sb_rdonly() change

2017-11-23 Thread Joe Perches
On Fri, 2017-11-24 at 15:07 +0900, OGAWA Hirofumi wrote:
> Joe Perches  writes:
> 
> > On Thu, 2017-11-23 at 15:29 +0900, OGAWA Hirofumi wrote:
> > > Ouch forgot to add stable@
> > > 
> > > -- 
> > > commit bc98a42c1f7d0f886c0c1b75a92a004976a46d9f introduced bug.
> > 
> > I think your commit message needs a bit more information.
> > 
> > It'd be useful to describe that the introduction of
> > sb_rdonly converted the bitwise & to a boolean and so
> > this conversion and comparison was made defective.
> > 
> > Are there any other instances of defective comparisons?
> 
> Please ask to that patch author.

The patch author, David Howells, is on the cc list.

btw:

It seems all the the other uses use a (bool) cast of the
(*flags & MS_RDONLY) and a comparison of sb_rdonly(sb).

It would make sense to change the argument type of the
ext[24]_setup_super int read_only arg to bool to match
the sb_rdonly() type. 


Re: [PATCH] fat: Fix sb_rdonly() change

2017-11-23 Thread Joe Perches
On Fri, 2017-11-24 at 15:07 +0900, OGAWA Hirofumi wrote:
> Joe Perches  writes:
> 
> > On Thu, 2017-11-23 at 15:29 +0900, OGAWA Hirofumi wrote:
> > > Ouch forgot to add stable@
> > > 
> > > -- 
> > > commit bc98a42c1f7d0f886c0c1b75a92a004976a46d9f introduced bug.
> > 
> > I think your commit message needs a bit more information.
> > 
> > It'd be useful to describe that the introduction of
> > sb_rdonly converted the bitwise & to a boolean and so
> > this conversion and comparison was made defective.
> > 
> > Are there any other instances of defective comparisons?
> 
> Please ask to that patch author.

The patch author, David Howells, is on the cc list.

btw:

It seems all the the other uses use a (bool) cast of the
(*flags & MS_RDONLY) and a comparison of sb_rdonly(sb).

It would make sense to change the argument type of the
ext[24]_setup_super int read_only arg to bool to match
the sb_rdonly() type. 


Re: [PATCH] fat: Fix sb_rdonly() change

2017-11-23 Thread OGAWA Hirofumi
Joe Perches  writes:

> On Thu, 2017-11-23 at 15:29 +0900, OGAWA Hirofumi wrote:
>> Ouch forgot to add stable@
>> 
>> -- 
>> commit bc98a42c1f7d0f886c0c1b75a92a004976a46d9f introduced bug.
>
> I think your commit message needs a bit more information.
>
> It'd be useful to describe that the introduction of
> sb_rdonly converted the bitwise & to a boolean and so
> this conversion and comparison was made defective.
>
> Are there any other instances of defective comparisons?

Please ask to that patch author.
-- 
OGAWA Hirofumi 


Re: [PATCH] fat: Fix sb_rdonly() change

2017-11-23 Thread OGAWA Hirofumi
Joe Perches  writes:

> On Thu, 2017-11-23 at 15:29 +0900, OGAWA Hirofumi wrote:
>> Ouch forgot to add stable@
>> 
>> -- 
>> commit bc98a42c1f7d0f886c0c1b75a92a004976a46d9f introduced bug.
>
> I think your commit message needs a bit more information.
>
> It'd be useful to describe that the introduction of
> sb_rdonly converted the bitwise & to a boolean and so
> this conversion and comparison was made defective.
>
> Are there any other instances of defective comparisons?

Please ask to that patch author.
-- 
OGAWA Hirofumi 


Re: [PATCH] fat: Fix sb_rdonly() change

2017-11-23 Thread Joe Perches
On Thu, 2017-11-23 at 15:29 +0900, OGAWA Hirofumi wrote:
> Ouch forgot to add stable@
> 
> -- 
> commit bc98a42c1f7d0f886c0c1b75a92a004976a46d9f introduced bug.

I think your commit message needs a bit more information.

It'd be useful to describe that the introduction of
sb_rdonly converted the bitwise & to a boolean and so
this conversion and comparison was made defective.

Are there any other instances of defective comparisons?


Re: [PATCH] fat: Fix sb_rdonly() change

2017-11-23 Thread Joe Perches
On Thu, 2017-11-23 at 15:29 +0900, OGAWA Hirofumi wrote:
> Ouch forgot to add stable@
> 
> -- 
> commit bc98a42c1f7d0f886c0c1b75a92a004976a46d9f introduced bug.

I think your commit message needs a bit more information.

It'd be useful to describe that the introduction of
sb_rdonly converted the bitwise & to a boolean and so
this conversion and comparison was made defective.

Are there any other instances of defective comparisons?


[PATCH] fat: Fix sb_rdonly() change

2017-11-22 Thread OGAWA Hirofumi
Ouch forgot to add stable@

-- 
commit bc98a42c1f7d0f886c0c1b75a92a004976a46d9f introduced bug.

Cc: 
Signed-off-by: OGAWA Hirofumi 
---

 fs/fat/inode.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN fs/fat/inode.c~fat-fix-sb_rdonly-fix fs/fat/inode.c
--- linux/fs/fat/inode.c~fat-fix-sb_rdonly-fix  2017-11-23 15:03:47.371667601 
+0900
+++ linux-hirofumi/fs/fat/inode.c   2017-11-23 15:04:07.654616440 +0900
@@ -779,7 +779,7 @@ static void __exit fat_destroy_inodecach
 
 static int fat_remount(struct super_block *sb, int *flags, char *data)
 {
-   int new_rdonly;
+   bool new_rdonly;
struct msdos_sb_info *sbi = MSDOS_SB(sb);
*flags |= MS_NODIRATIME | (sbi->options.isvfat ? 0 : MS_NOATIME);
 
_
-- 
OGAWA Hirofumi 


[PATCH] fat: Fix sb_rdonly() change

2017-11-22 Thread OGAWA Hirofumi
Ouch forgot to add stable@

-- 
commit bc98a42c1f7d0f886c0c1b75a92a004976a46d9f introduced bug.

Cc: 
Signed-off-by: OGAWA Hirofumi 
---

 fs/fat/inode.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN fs/fat/inode.c~fat-fix-sb_rdonly-fix fs/fat/inode.c
--- linux/fs/fat/inode.c~fat-fix-sb_rdonly-fix  2017-11-23 15:03:47.371667601 
+0900
+++ linux-hirofumi/fs/fat/inode.c   2017-11-23 15:04:07.654616440 +0900
@@ -779,7 +779,7 @@ static void __exit fat_destroy_inodecach
 
 static int fat_remount(struct super_block *sb, int *flags, char *data)
 {
-   int new_rdonly;
+   bool new_rdonly;
struct msdos_sb_info *sbi = MSDOS_SB(sb);
*flags |= MS_NODIRATIME | (sbi->options.isvfat ? 0 : MS_NOATIME);
 
_
-- 
OGAWA Hirofumi 


[PATCH] fat: Fix sb_rdonly() change

2017-11-22 Thread OGAWA Hirofumi
commit bc98a42c1f7d0f886c0c1b75a92a004976a46d9f introduced bug.

Signed-off-by: OGAWA Hirofumi 
---

 fs/fat/inode.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN fs/fat/inode.c~fat-fix-sb_rdonly-fix fs/fat/inode.c
--- linux/fs/fat/inode.c~fat-fix-sb_rdonly-fix  2017-11-23 15:03:47.371667601 
+0900
+++ linux-hirofumi/fs/fat/inode.c   2017-11-23 15:04:07.654616440 +0900
@@ -779,7 +779,7 @@ static void __exit fat_destroy_inodecach
 
 static int fat_remount(struct super_block *sb, int *flags, char *data)
 {
-   int new_rdonly;
+   bool new_rdonly;
struct msdos_sb_info *sbi = MSDOS_SB(sb);
*flags |= MS_NODIRATIME | (sbi->options.isvfat ? 0 : MS_NOATIME);
 
_

-- 
OGAWA Hirofumi 


[PATCH] fat: Fix sb_rdonly() change

2017-11-22 Thread OGAWA Hirofumi
commit bc98a42c1f7d0f886c0c1b75a92a004976a46d9f introduced bug.

Signed-off-by: OGAWA Hirofumi 
---

 fs/fat/inode.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN fs/fat/inode.c~fat-fix-sb_rdonly-fix fs/fat/inode.c
--- linux/fs/fat/inode.c~fat-fix-sb_rdonly-fix  2017-11-23 15:03:47.371667601 
+0900
+++ linux-hirofumi/fs/fat/inode.c   2017-11-23 15:04:07.654616440 +0900
@@ -779,7 +779,7 @@ static void __exit fat_destroy_inodecach
 
 static int fat_remount(struct super_block *sb, int *flags, char *data)
 {
-   int new_rdonly;
+   bool new_rdonly;
struct msdos_sb_info *sbi = MSDOS_SB(sb);
*flags |= MS_NODIRATIME | (sbi->options.isvfat ? 0 : MS_NOATIME);
 
_

-- 
OGAWA Hirofumi