xfs
[Top] [All Lists]

Patch fs/xfs/xfs_alloc.c

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Patch fs/xfs/xfs_alloc.c
From: Poyo VL <poyo_vl@xxxxxxxxx>
Date: Thu, 2 Sep 2010 00:41:55 -0700 (PDT)
Cc: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1283413315; bh=Zzby5lqYTqQqUNuFBy676jULrNR12tB2sZB6lAgICo8=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=D4F9hDvK5yBWjAV0olxpoJKxXX3VrNWFyHNjBekfctWvJ+/ddstjnGTlTk3CFz4vPWqdTExW/ivcOx/ChNIXwCDEDNWLmgxfneMhejxE1voxunMiVahjhWhmUK0aIQAFezh/Zfcyy3TzQIaGD3esxoplRxw2eu3/W9T87bAkRa4=
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=XwKGMAF9twy1PnYmaCDaVWhojQRn+s7BVEL0vIbJIG4qycaDMtPAdQzwRVu6FGN5Gzpmfjb/ZT/v+ugQEZ2xgmR7rU4/+bLYuqK2HC1NMVoR4GpwFs/s5NE+HuIJBnRW2h/WV4WRWMDTEb5iITEF0eSDt1+bBXR14cQstM7Ia5s=;
In-reply-to: <20100902052106.GU705@dastard>
References: <356042.32153.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <20100902052106.GU705@dastard>
Im using "gcc version 4.5.0 20100604 [gcc-4_5-branch revision 160292] (SUSE 
Linux)"

Before compiling kernel (2.6.35.4) I selected from menuconfig all XFS 
"options": 
Quota supprt, POSIX ACL support, Realtime subvolume support and Debugging 
support. I saved the .config and I typed "make". 


I got the following warnings:

fs/xfs/xfs_alloc.c: In function ‘xfs_alloc_ag_vextent_near’:
fs/xfs/xfs_alloc.c:694:15: warning: ‘ltlena’ may be used uninitialized in this 
function
fs/xfs/xfs_alloc.c:683:15: warning: ‘gtlena’ may be used uninitialized in this 
function

So I tried to initialize those variables (structures) with 0.

Sorry, I am not neither a C, nor a kernel expert.

"Patch":

--- xfs_alloc.c    2010-09-01 22:00:50.044004253 +0300
+++ xfs_alloc_2.c    2010-09-01 22:01:32.400007466 +0300
@@ -680,7 +680,7 @@
     xfs_agblock_t    gtbnoa;        /* aligned ... */
     xfs_extlen_t    gtdiff;        /* difference to right side entry */
     xfs_extlen_t    gtlen;        /* length of right side entry */
-    xfs_extlen_t    gtlena;        /* aligned ... */
+    xfs_extlen_t    gtlena = {0};        /* aligned ... */
     xfs_agblock_t    gtnew;        /* useful start bno of right side */
     int        error;        /* error code */
     int        i;        /* result code, temporary */
@@ -691,7 +691,7 @@
     /*REFERENCED*/
     xfs_agblock_t    ltend;        /* end bno of left side entry */
     xfs_extlen_t    ltlen;        /* length of left side entry */
-    xfs_extlen_t    ltlena;        /* aligned ... */
+    xfs_extlen_t    ltlena = {0};        /* aligned ... */
     xfs_agblock_t    ltnew;        /* useful start bno of left side */
     xfs_extlen_t    rlen;        /* length of returned extent */
 #if defined(DEBUG) && defined(__KERNEL__)

Signed-off-by: Ionut Gabriel Popescu <poyo_vl@xxxxxxxxx>

Thank you for your time.



----- Original Message ----
From: Dave Chinner <david@xxxxxxxxxxxxx>
To: Poyo VL <poyo_vl@xxxxxxxxx>
Cc: aelder@xxxxxxx; xfs@xxxxxxxxxxx
Sent: Thu, September 2, 2010 8:21:06 AM
Subject: Re: Patch fs/xfs/xfs_alloc.c

On Wed, Sep 01, 2010 at 12:27:39PM -0700, Poyo VL wrote:
> File: fs/xfs/xfs_alloc.c
> Kernel: 2.6.35.4
> 
> It is not an important patch, but I got some warnings:
> 
> fs/xfs/xfs_alloc.c: In function ‘xfs_alloc_ag_vextent_near’:
> fs/xfs/xfs_alloc.c:694:15: warning: ‘ltlena’ may be used uninitialized in 
> this 

> function
> fs/xfs/xfs_alloc.c:683:15: warning: ‘gtlena’ may be used uninitialized in 
> this 

> function

I don't see this. What compiler version are you using?

Also, for posting patches, you might want to read and follow
Documentation/SubmittingPatches.txt. At minimum, you need to include
a Signed-off-by tag (we can't accept patches without that) and
attach your patches as plain text.

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx





<Prev in Thread] Current Thread [Next in Thread>