Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1715645 > unrolled thread

[PATCH 1/2] ext4: Delete an error message for a failed memory allocation in ext4_multi_mount_protect()

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2017-08-19 13:50 +0200
Last post2017-08-24 21:20 +0200
Articles 5 — 4 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/2] ext4: Delete an error message for a failed memory  allocation in ext4_multi_mount_protect() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-19 13:50 +0200
    Re: [PATCH 1/2] ext4: Delete an error message for a failed memory  allocation in ext4_multi_mount_protect() Eric Sandeen <esandeen@redhat.com> - 2017-08-19 19:10 +0200
      Re: ext4: Delete an error message for a failed memory allocation in  ext4_multi_mount_protect() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-19 20:10 +0200
        Re: ext4: Delete an error message for a failed memory allocation in  ext4_multi_mount_protect() Theodore Ts'o <tytso@mit.edu> - 2017-08-24 19:50 +0200
      Re: [PATCH 1/2] ext4: Delete an error message for a failed memory  allocation in ext4_multi_mount_protect() Dan Carpenter <dan.carpenter@oracle.com> - 2017-08-24 21:20 +0200

#1715645 — [PATCH 1/2] ext4: Delete an error message for a failed memory allocation in ext4_multi_mount_protect()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-08-19 13:50 +0200
Subject[PATCH 1/2] ext4: Delete an error message for a failed memory allocation in ext4_multi_mount_protect()
Message-ID<ugaql-NZ-5@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 19 Aug 2017 13:04:50 +0200

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 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;
 
-- 
2.14.0

[toc] | [next] | [standalone]


#1715688

FromEric Sandeen <esandeen@redhat.com>
Date2017-08-19 19:10 +0200
Message-ID<ugfq2-42G-11@gated-at.bofh.it>
In reply to#1715645
On 8/19/17 6:47 AM, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> 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 <elfring@users.sourceforge.net>
> ---
>  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;
>  
> 

[toc] | [prev] | [next] | [standalone]


#1715715 — Re: ext4: Delete an error message for a failed memory allocation in ext4_multi_mount_protect()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-08-19 20:10 +0200
SubjectRe: ext4: Delete an error message for a failed memory allocation in ext4_multi_mount_protect()
Message-ID<uggm6-4B1-13@gated-at.bofh.it>
In reply to#1715688
>> 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,

Do you find the default allocation failure report sufficient?


> but is Coccinelle now warning about explicit memory allocation failure warnings?)

This software tool can help to find source code places for further
development considerations. Would you like to clarify a corresponding
search pattern a bit more?

Regards,
Markus

[toc] | [prev] | [next] | [standalone]


#1719472 — Re: ext4: Delete an error message for a failed memory allocation in ext4_multi_mount_protect()

FromTheodore Ts'o <tytso@mit.edu>
Date2017-08-24 19:50 +0200
SubjectRe: ext4: Delete an error message for a failed memory allocation in ext4_multi_mount_protect()
Message-ID<ui4qu-1bx-7@gated-at.bofh.it>
In reply to#1715715
On Sat, Aug 19, 2017 at 08:00:31PM +0200, SF Markus Elfring wrote:
> >> 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,
> 
> Do you find the default allocation failure report sufficient?

From a helpdesk reporting situation, having a more specific message
when there is a MMP failure causing the mount to fail is definitely
useful.

So, NACK.

					- Ted

[toc] | [prev] | [next] | [standalone]


#1719517

FromDan Carpenter <dan.carpenter@oracle.com>
Date2017-08-24 21:20 +0200
Message-ID<ui5Pz-28K-3@gated-at.bofh.it>
In reply to#1715688
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 <elfring@users.sourceforge.net>
> > 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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web