Re: [PATCH 1/2] ext4: Delete an error message for a failed memory allocation in ext4_multi_mount_protect()
On Sat, Aug 19, 2017 at 12:08:29PM -0500, Eric Sandeen wrote: > On 8/19/17 6:47 AM, SF Markus Elfring wrote: > > From: Markus Elfring> > Date: Sat, 19 Aug 2017 13:04:50 +0200 > > > > Omit an extra message for a memory allocation failure in this function. > > I might be dense, but what makes this message "extra?" > > (I suppose kmalloc squawks too if it fails, but is Coccinelle > now warning about explicit memory allocation failure warnings?) > Yeah... Checkpatch complains that the kmalloc squawks is enough. "WARNING: Possible unnecessary 'out of memory' message". This allocation is small so it's guaranteed to succeed in current kernels. regards, dan carpenter
Re: [PATCH 1/2] ext4: Delete an error message for a failed memory allocation in ext4_multi_mount_protect()
On Sat, Aug 19, 2017 at 12:08:29PM -0500, Eric Sandeen wrote: > On 8/19/17 6:47 AM, SF Markus Elfring wrote: > > From: Markus Elfring > > Date: Sat, 19 Aug 2017 13:04:50 +0200 > > > > Omit an extra message for a memory allocation failure in this function. > > I might be dense, but what makes this message "extra?" > > (I suppose kmalloc squawks too if it fails, but is Coccinelle > now warning about explicit memory allocation failure warnings?) > Yeah... Checkpatch complains that the kmalloc squawks is enough. "WARNING: Possible unnecessary 'out of memory' message". This allocation is small so it's guaranteed to succeed in current kernels. regards, dan carpenter
Re: [PATCH 1/2] ext4: Delete an error message for a failed memory allocation in ext4_multi_mount_protect()
On 8/19/17 6:47 AM, SF Markus Elfring wrote: > From: Markus Elfring> Date: Sat, 19 Aug 2017 13:04:50 +0200 > > Omit an extra message for a memory allocation failure in this function. I might be dense, but what makes this message "extra?" (I suppose kmalloc squawks too if it fails, but is Coccinelle now warning about explicit memory allocation failure warnings?) -Eric > This issue was detected by using the Coccinelle software. > > Signed-off-by: Markus Elfring > --- > fs/ext4/mmp.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c > index eb9835638680..1ce00453f612 100644 > --- a/fs/ext4/mmp.c > +++ b/fs/ext4/mmp.c > @@ -371,7 +371,6 @@ int ext4_multi_mount_protect(struct super_block *sb, > - if (!mmpd_data) { > - ext4_warning(sb, "not enough memory for mmpd_data"); > + if (!mmpd_data) > goto failed; > - } > + > mmpd_data->sb = sb; > mmpd_data->bh = bh; > >
Re: [PATCH 1/2] ext4: Delete an error message for a failed memory allocation in ext4_multi_mount_protect()
On 8/19/17 6:47 AM, SF Markus Elfring wrote: > From: Markus Elfring > Date: Sat, 19 Aug 2017 13:04:50 +0200 > > Omit an extra message for a memory allocation failure in this function. I might be dense, but what makes this message "extra?" (I suppose kmalloc squawks too if it fails, but is Coccinelle now warning about explicit memory allocation failure warnings?) -Eric > This issue was detected by using the Coccinelle software. > > Signed-off-by: Markus Elfring > --- > fs/ext4/mmp.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c > index eb9835638680..1ce00453f612 100644 > --- a/fs/ext4/mmp.c > +++ b/fs/ext4/mmp.c > @@ -371,7 +371,6 @@ int ext4_multi_mount_protect(struct super_block *sb, > - if (!mmpd_data) { > - ext4_warning(sb, "not enough memory for mmpd_data"); > + if (!mmpd_data) > goto failed; > - } > + > mmpd_data->sb = sb; > mmpd_data->bh = bh; > >