From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 06/16] GFS2: Add non-try locks back to get_local_rgrp
Date: Thu, 5 Jan 2012 11:51:52 +0000 [thread overview]
Message-ID: <1325764322-10807-7-git-send-email-swhiteho@redhat.com> (raw)
In-Reply-To: <1325764322-10807-1-git-send-email-swhiteho@redhat.com>
From: Bob Peterson <rpeterso@redhat.com>
This upstream patch had what I believe is an unintended consequence:
http://git.kernel.org/?p=linux/kernel/git/steve/gfs2-3.0-nmw.git;a=commitdiff;h=beca42486749c1538a5ed58fe9dcc9f26d428c93
The patch changed function get_local_rgrp such that it ONLY
used TRY locks for RGRP searches. Prior to that patch, the code
used TRY locks during the first loop, and if that was unsuccessful,
it used normal blocking locks on subsequent searches. This patch
changes it back to the old way.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 96bd6d7..a1a815b 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -978,7 +978,7 @@ static int get_local_rgrp(struct gfs2_inode *ip, u64 *last_unlinked)
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
struct gfs2_rgrpd *rgd, *begin = NULL;
struct gfs2_alloc *al = ip->i_alloc;
- int error, rg_locked;
+ int error, rg_locked, flags = LM_FLAG_TRY;
int loops = 0;
if (ip->i_rgd && rgrp_contains_block(ip->i_rgd, ip->i_goal))
@@ -997,7 +997,7 @@ static int get_local_rgrp(struct gfs2_inode *ip, u64 *last_unlinked)
error = 0;
} else {
error = gfs2_glock_nq_init(rgd->rd_gl, LM_ST_EXCLUSIVE,
- LM_FLAG_TRY, &al->al_rgd_gh);
+ flags, &al->al_rgd_gh);
}
switch (error) {
case 0:
@@ -1012,8 +1012,10 @@ static int get_local_rgrp(struct gfs2_inode *ip, u64 *last_unlinked)
/* fall through */
case GLR_TRYFAILED:
rgd = gfs2_rgrpd_get_next(rgd);
- if (rgd == begin)
+ if (rgd == begin) {
+ flags = 0;
loops++;
+ }
break;
default:
return error;
--
1.7.4
next prev parent reply other threads:[~2012-01-05 11:51 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-05 11:51 [Cluster-devel] GFS2: Pre-pull patch posting (merge window) Steven Whitehouse
2012-01-05 11:51 ` [Cluster-devel] [PATCH 01/16] GFS2: Fix up REQ flags Steven Whitehouse
2012-01-05 11:51 ` [Cluster-devel] [PATCH 02/16] GFS2: Add readahead to sequential directory traversal Steven Whitehouse
2012-01-05 11:51 ` [Cluster-devel] [PATCH 03/16] GFS2: More automated code analysis fixes Steven Whitehouse
2012-01-05 11:51 ` [Cluster-devel] [PATCH 04/16] GFS2: Fix very unlikley memory leak in ACL xattr code Steven Whitehouse
2012-01-05 11:51 ` [Cluster-devel] [PATCH 05/16] GFS2: f_ra is always valid in dir readahead function Steven Whitehouse
2012-01-05 11:51 ` Steven Whitehouse [this message]
2012-01-05 11:51 ` [Cluster-devel] [PATCH 07/16] GFS2: combine gfs2_alloc_block and gfs2_alloc_di Steven Whitehouse
2012-01-05 11:51 ` [Cluster-devel] [PATCH 08/16] GFS2: remove vestigial al_alloced Steven Whitehouse
2012-01-05 11:51 ` [Cluster-devel] [PATCH 09/16] GFS2: O_(D)SYNC support for fallocate Steven Whitehouse
2012-01-05 11:51 ` [Cluster-devel] [PATCH 10/16] GFS2: move toward a generic multi-block allocator Steven Whitehouse
2012-01-05 11:51 ` [Cluster-devel] [PATCH 11/16] GFS2: Fix up "off by one" in the previous patch Steven Whitehouse
2012-01-05 11:51 ` [Cluster-devel] [PATCH 12/16] GFS2: split function rgblk_search Steven Whitehouse
2012-01-05 11:51 ` [Cluster-devel] [PATCH 13/16] GFS2: decouple quota allocations from block allocations Steven Whitehouse
2012-01-05 11:52 ` [Cluster-devel] [PATCH 14/16] GFS2: Fix multi-block allocation Steven Whitehouse
2012-01-05 11:52 ` [Cluster-devel] [PATCH 15/16] GFS2: We only need one ACL getting function Steven Whitehouse
2012-01-05 11:52 ` [Cluster-devel] [PATCH 16/16] GFS2: local functions should be static Steven Whitehouse
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=1325764322-10807-7-git-send-email-swhiteho@redhat.com \
--to=swhiteho@redhat.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;
as well as URLs for NNTP newsgroup(s).