All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: xfs@oss.sgi.com
Subject: [PATCH 1/9] xfs: don't try to use the filestream allocator for metadata allocations
Date: Sat, 12 Apr 2014 10:01:55 +0200	[thread overview]
Message-ID: <1397289723-26243-2-git-send-email-hch@lst.de> (raw)
In-Reply-To: <1397289723-26243-1-git-send-email-hch@lst.de>

xfs_bmap_btalloc_nullfb has two entirely different control flows when
using the filestream allocator vs the regular one, but it get the
conditionals wrong and ends up mixing the two for metadata allocations.
Fix this by adding a missing userdata check and slight refactoring.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_bmap.c |   42 ++++++++++++++++++++----------------------
 1 file changed, 20 insertions(+), 22 deletions(-)

diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index f0efc7e..3340f0e 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -3566,33 +3566,31 @@ xfs_bmap_btalloc_nullfb(
 		} else
 			notinit = 1;
 
-		if (xfs_inode_is_filestream(ap->ip)) {
+		if (xfs_inode_is_filestream(ap->ip) && ap->userdata) {
 			if (*blen >= args->maxlen)
 				break;
 
-			if (ap->userdata) {
-				/*
-				 * If startag is an invalid AG, we've
-				 * come here once before and
-				 * xfs_filestream_new_ag picked the
-				 * best currently available.
-				 *
-				 * Don't continue looping, since we
-				 * could loop forever.
-				 */
-				if (startag == NULLAGNUMBER)
-					break;
+			/*
+			 * If startag is an invalid AG, we've
+			 * come here once before and
+			 * xfs_filestream_new_ag picked the
+			 * best currently available.
+			 *
+			 * Don't continue looping, since we
+			 * could loop forever.
+			 */
+			if (startag == NULLAGNUMBER)
+				break;
 
-				error = xfs_filestream_new_ag(ap, &ag);
-				xfs_perag_put(pag);
-				if (error)
-					return error;
+			error = xfs_filestream_new_ag(ap, &ag);
+			xfs_perag_put(pag);
+			if (error)
+				return error;
 
-				/* loop again to set 'blen'*/
-				startag = NULLAGNUMBER;
-				pag = xfs_perag_get(mp, ag);
-				continue;
-			}
+			/* loop again to set 'blen'*/
+			startag = NULLAGNUMBER;
+			pag = xfs_perag_get(mp, ag);
+			continue;
 		}
 		if (++ag == mp->m_sb.sb_agcount)
 			ag = 0;
-- 
1.7.10.4

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

  reply	other threads:[~2014-04-12  7:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-12  8:01 filestream allocator rewrite Christoph Hellwig
2014-04-12  8:01 ` Christoph Hellwig [this message]
2014-04-12  8:01 ` [PATCH 2/9] xfs: split xfs_bmap_btalloc_nullfb Christoph Hellwig
2014-04-14  1:55   ` Dave Chinner
2014-04-14  7:03     ` Christoph Hellwig
2014-04-14  7:17       ` Dave Chinner
2014-04-12  8:01 ` [PATCH 3/9] xfs: handle duplicate entries in xfs_mru_cache_insert Christoph Hellwig
2014-04-12  8:01 ` [PATCH 4/9] xfs: embedd mru_elem into parent structure Christoph Hellwig
2014-04-12  8:01 ` [PATCH 5/9] xfs: remove XFS_IFILESTREAM Christoph Hellwig
2014-04-12  8:02 ` [PATCH 6/9] xfs: rewrite the filestream allocator using the dentry cache Christoph Hellwig
2014-04-12  8:02 ` [PATCH 7/9] xfs: don't create a slab cache for filestream items Christoph Hellwig
2014-04-12  8:02 ` [PATCH 8/9] xfs: remove xfs_filestream_associate Christoph Hellwig
2014-04-12  8:02 ` [PATCH 9/9] xfs: add filestream allocator tracepoints Christoph Hellwig
2014-04-14  2:23 ` filestream allocator rewrite Dave Chinner
2014-04-22 21:06   ` 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=1397289723-26243-2-git-send-email-hch@lst.de \
    --to=hch@lst.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.