xfs
[Top] [All Lists]

Re: [PATCH 12/12] xfs: Remove the macro XFS_BUFTARG_NAME

To: aelder@xxxxxxx
Subject: Re: [PATCH 12/12] xfs: Remove the macro XFS_BUFTARG_NAME
From: Chandra Seetharaman <sekharan@xxxxxxxxxx>
Date: Fri, 22 Jul 2011 14:23:25 -0700
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1311364181.2771.114.camel@doink>
Organization: IBM
References: <20110722003226.21069.58401.sendpatchset@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20110722003408.21069.44409.sendpatchset@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <1311364181.2771.114.camel@doink>
Reply-to: sekharan@xxxxxxxxxx
On Fri, 2011-07-22 at 14:49 -0500, Alex Elder wrote:
> On Thu, 2011-07-21 at 17:34 -0700, Chandra Seetharaman wrote:
> > Remove the definition and usages of the macro XFS_BUFTARG_NAME.
> > 
> > Signed-off-by: Chandra Seetharaman <sekharan@xxxxxxxxxx>
> > Reviewed-by: Christoph Hellwig <hch@xxxxxx>
> 
> 
> Wow, I hadn't looked at the definition of
> xfs_buf_target_name() before.  It's not safe
> (using a pointer to since-released stack space),
> though in practice it's going to be fine.
> 
> Defining it as an inline function with a static
> buffer would at least avoid that, though it
> means it's not reentrant either.
> 
> I would personally prefer doing it that way though.
> 
> /* NB: returns pointer to buffer reused on each call */
> static inline char *
> xfs_buf_target_name(struct xfs_buftarg *target)
> {
>         static char __b[BDEVNAME_SIZE];
> 
>         return bdevname(target->bt_bdev, __b);
> }
> 
> 
> Anyway, you didn't change this, but you're touching
> the code that uses it.  So unless others object I
> would like to see this changed along with the
> rest of what you do here (which is all good, by
> the way).
> 
> Either way:
> 
> Reviewed-by: Alex Elder <aelder@xxxxxxx>
> 
> 


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