public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Alex Elder <aelder@sgi.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 2/10] xfs: fix min bufsize bugs in two places
Date: Mon, 12 Apr 2010 16:32:48 +1000	[thread overview]
Message-ID: <20100412063248.GG2493@dastard> (raw)
In-Reply-To: <1270852013.7840.132.camel@doink>

On Fri, Apr 09, 2010 at 05:26:53PM -0500, Alex Elder wrote:
> This fixes a bug in two places that I found by inspection.  In
> xlog_find_verify_cycle() and xlog_write_log_records(), the code
> attempts to allocate a buffer to hold as many blocks as possible.
> It gives up if the number of blocks to be allocated gets too small.
> Right now it uses log->l_sectbb_log as that lower bound, but I'm
> sure it's supposed to be the actual log sector size instead.  That
> is, the lower bound should be (1 << log->l_sectbb_log).
> 
> Also define a simple macro xlog_sectbb(log) to represent the number
> of basic blocks in a sector for the given log.
> 
> (No change from original submission; I have implemented Christoph's
> suggestion about storing l_sectsize rather than l_sectbb_log in
> a new, separate patch in this series.)
> 
> Signed-off-by: Alex Elder <aelder@sgi.com>
> 
> ---
> fs/xfs/xfs_log_recover.c |   21 +++++++++++++++++----
>  fs/xfs/xfs_log_recover.c |   21 +++++++++++++++++----
>  1 file changed, 17 insertions(+), 4 deletions(-)
> 
> Index: b/fs/xfs/xfs_log_recover.c
> ===================================================================
> --- a/fs/xfs/xfs_log_recover.c
> +++ b/fs/xfs/xfs_log_recover.c
> @@ -66,6 +66,9 @@ STATIC void	xlog_recover_check_summary(x
>  	((bbs + (log)->l_sectbb_mask + 1) & ~(log)->l_sectbb_mask) : (bbs) )
>  #define XLOG_SECTOR_ROUNDDOWN_BLKNO(log, bno)	((bno) & ~(log)->l_sectbb_mask)
>  
> +/* Number of basic blocks in a log sector */
> +#define xlog_sectbb(log) (1 << (log)->l_sectbb_log)
> +

Can you do this without the #define? There's a spot in
xlog_alloc_log() where the l_sectbb_mask is set up that
open code this shift, so it seems to me that this woul dbe the spot
to set up a l_sect_size variable and reference that instead...

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2010-04-13  1:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-09 22:26 [PATCH 2/10] xfs: fix min bufsize bugs in two places Alex Elder
2010-04-12  6:32 ` Dave Chinner [this message]
2010-04-13  5:12   ` Dave Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100412063248.GG2493@dastard \
    --to=david@fromorbit.com \
    --cc=aelder@sgi.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox