cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] GFS2: Pre-pull patch posting
@ 2015-02-10 10:36 Steven Whitehouse
  2015-02-10 10:36 ` [Cluster-devel] [PATCH 1/5] GFS2: Eliminate __gfs2_glock_remove_from_lru Steven Whitehouse
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Steven Whitehouse @ 2015-02-10 10:36 UTC (permalink / raw)
  To: cluster-devel.redhat.com

This time we have mostly clean ups. There is a bug fix for a NULL dereference
relating to ACLs, and another which improves (but does not fix entirely) an
allocation fall-back code path. The other three patches are small clean ups.

Steve.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Cluster-devel] [PATCH 1/5] GFS2: Eliminate __gfs2_glock_remove_from_lru
  2015-02-10 10:36 [Cluster-devel] GFS2: Pre-pull patch posting Steven Whitehouse
@ 2015-02-10 10:36 ` Steven Whitehouse
  2015-02-10 10:36 ` [Cluster-devel] [PATCH 2/5] GFS2: fix sprintf format specifier Steven Whitehouse
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Steven Whitehouse @ 2015-02-10 10:36 UTC (permalink / raw)
  To: cluster-devel.redhat.com

From: Bob Peterson <rpeterso@redhat.com>

Since the only caller of function __gfs2_glock_remove_from_lru locks the
same spin_lock as gfs2_glock_remove_from_lru, the functions can be combined.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index a23524a..aeb7bc9 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -173,19 +173,14 @@ void gfs2_glock_add_to_lru(struct gfs2_glock *gl)
 	spin_unlock(&lru_lock);
 }
 
-static void __gfs2_glock_remove_from_lru(struct gfs2_glock *gl)
+static void gfs2_glock_remove_from_lru(struct gfs2_glock *gl)
 {
+	spin_lock(&lru_lock);
 	if (!list_empty(&gl->gl_lru)) {
 		list_del_init(&gl->gl_lru);
 		atomic_dec(&lru_count);
 		clear_bit(GLF_LRU, &gl->gl_flags);
 	}
-}
-
-static void gfs2_glock_remove_from_lru(struct gfs2_glock *gl)
-{
-	spin_lock(&lru_lock);
-	__gfs2_glock_remove_from_lru(gl);
 	spin_unlock(&lru_lock);
 }
 
@@ -205,9 +200,7 @@ void gfs2_glock_put(struct gfs2_glock *gl)
 
 	lockref_mark_dead(&gl->gl_lockref);
 
-	spin_lock(&lru_lock);
-	__gfs2_glock_remove_from_lru(gl);
-	spin_unlock(&lru_lock);
+	gfs2_glock_remove_from_lru(gl);
 	spin_unlock(&gl->gl_lockref.lock);
 	spin_lock_bucket(gl->gl_hash);
 	hlist_bl_del_rcu(&gl->gl_list);
-- 
1.8.3.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Cluster-devel] [PATCH 2/5] GFS2: fix sprintf format specifier
  2015-02-10 10:36 [Cluster-devel] GFS2: Pre-pull patch posting Steven Whitehouse
  2015-02-10 10:36 ` [Cluster-devel] [PATCH 1/5] GFS2: Eliminate __gfs2_glock_remove_from_lru Steven Whitehouse
@ 2015-02-10 10:36 ` Steven Whitehouse
  2015-02-10 10:36 ` [Cluster-devel] [PATCH 3/5] GFS2: Eliminate a nonsense goto Steven Whitehouse
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Steven Whitehouse @ 2015-02-10 10:36 UTC (permalink / raw)
  To: cluster-devel.redhat.com

From: alex chen <alex.chen@huawei.com>

Sprintf format specifier "%d" and "%u" are mixed up in
gfs2_recovery_done() and freeze_show(). So correct them.

Signed-off-by: Alex Chen <alex.chen@huawei.com>
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

diff --git a/fs/gfs2/recovery.c b/fs/gfs2/recovery.c
index 573bd3b..1b64577 100644
--- a/fs/gfs2/recovery.c
+++ b/fs/gfs2/recovery.c
@@ -439,7 +439,7 @@ static void gfs2_recovery_done(struct gfs2_sbd *sdp, unsigned int jid,
 
         ls->ls_recover_jid_done = jid;
         ls->ls_recover_jid_status = message;
-	sprintf(env_jid, "JID=%d", jid);
+	sprintf(env_jid, "JID=%u", jid);
 	sprintf(env_status, "RECOVERY=%s",
 		message == LM_RD_SUCCESS ? "Done" : "Failed");
         kobject_uevent_env(&sdp->sd_kobj, KOBJ_CHANGE, envp);
diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c
index 3ab566b..ae8e881 100644
--- a/fs/gfs2/sys.c
+++ b/fs/gfs2/sys.c
@@ -96,7 +96,7 @@ static ssize_t freeze_show(struct gfs2_sbd *sdp, char *buf)
 	struct super_block *sb = sdp->sd_vfs;
 	int frozen = (sb->s_writers.frozen == SB_UNFROZEN) ? 0 : 1;
 
-	return snprintf(buf, PAGE_SIZE, "%u\n", frozen);
+	return snprintf(buf, PAGE_SIZE, "%d\n", frozen);
 }
 
 static ssize_t freeze_store(struct gfs2_sbd *sdp, const char *buf, size_t len)
-- 
1.8.3.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Cluster-devel] [PATCH 3/5] GFS2: Eliminate a nonsense goto
  2015-02-10 10:36 [Cluster-devel] GFS2: Pre-pull patch posting Steven Whitehouse
  2015-02-10 10:36 ` [Cluster-devel] [PATCH 1/5] GFS2: Eliminate __gfs2_glock_remove_from_lru Steven Whitehouse
  2015-02-10 10:36 ` [Cluster-devel] [PATCH 2/5] GFS2: fix sprintf format specifier Steven Whitehouse
@ 2015-02-10 10:36 ` Steven Whitehouse
  2015-02-10 10:36 ` [Cluster-devel] [PATCH 4/5] GFS2: use __vmalloc GFP_NOFS for fs-related allocations Steven Whitehouse
  2015-02-10 10:36 ` [Cluster-devel] [PATCH 5/5] GFS2: Fix crash during ACL deletion in acl max entry check in gfs2_set_acl() Steven Whitehouse
  4 siblings, 0 replies; 6+ messages in thread
From: Steven Whitehouse @ 2015-02-10 10:36 UTC (permalink / raw)
  To: cluster-devel.redhat.com

From: Bob Peterson <rpeterso@redhat.com>

This patch just removes a goto that did nothing.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 9054002..73c72253 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -543,10 +543,7 @@ static int link_dinode(struct gfs2_inode *dip, const struct qstr *name,
 	}
 
 	error = gfs2_dir_add(&dip->i_inode, name, ip, da);
-	if (error)
-		goto fail_end_trans;
 
-fail_end_trans:
 	gfs2_trans_end(sdp);
 fail_ipreserv:
 	gfs2_inplace_release(dip);
-- 
1.8.3.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Cluster-devel] [PATCH 4/5] GFS2: use __vmalloc GFP_NOFS for fs-related allocations.
  2015-02-10 10:36 [Cluster-devel] GFS2: Pre-pull patch posting Steven Whitehouse
                   ` (2 preceding siblings ...)
  2015-02-10 10:36 ` [Cluster-devel] [PATCH 3/5] GFS2: Eliminate a nonsense goto Steven Whitehouse
@ 2015-02-10 10:36 ` Steven Whitehouse
  2015-02-10 10:36 ` [Cluster-devel] [PATCH 5/5] GFS2: Fix crash during ACL deletion in acl max entry check in gfs2_set_acl() Steven Whitehouse
  4 siblings, 0 replies; 6+ messages in thread
From: Steven Whitehouse @ 2015-02-10 10:36 UTC (permalink / raw)
  To: cluster-devel.redhat.com

From: Oleg Drokin <green@linuxhacker.ru>

leaf_dealloc uses vzalloc as a fallback to kzalloc(GFP_NOFS), so
it clearly does not want any shrinker activity within the fs itself.
convert vzalloc into __vmalloc(GFP_NOFS|__GFP_ZERO) to better achieve
this goal.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c
index c5a34f0..6371192 100644
--- a/fs/gfs2/dir.c
+++ b/fs/gfs2/dir.c
@@ -1896,7 +1896,8 @@ static int leaf_dealloc(struct gfs2_inode *dip, u32 index, u32 len,
 
 	ht = kzalloc(size, GFP_NOFS | __GFP_NOWARN);
 	if (ht == NULL)
-		ht = vzalloc(size);
+		ht = __vmalloc(size, GFP_NOFS | __GFP_NOWARN | __GFP_ZERO,
+			       PAGE_KERNEL);
 	if (!ht)
 		return -ENOMEM;
 
-- 
1.8.3.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Cluster-devel] [PATCH 5/5] GFS2: Fix crash during ACL deletion in acl max entry check in gfs2_set_acl()
  2015-02-10 10:36 [Cluster-devel] GFS2: Pre-pull patch posting Steven Whitehouse
                   ` (3 preceding siblings ...)
  2015-02-10 10:36 ` [Cluster-devel] [PATCH 4/5] GFS2: use __vmalloc GFP_NOFS for fs-related allocations Steven Whitehouse
@ 2015-02-10 10:36 ` Steven Whitehouse
  4 siblings, 0 replies; 6+ messages in thread
From: Steven Whitehouse @ 2015-02-10 10:36 UTC (permalink / raw)
  To: cluster-devel.redhat.com

From: Andrew Elble <aweits@rit.edu>

Fixes: e01580bf9e ("gfs2: use generic posix ACL infrastructure")
Reported-by: Eric Meddaugh <etmsys@rit.edu>
Tested-by: Eric Meddaugh <etmsys@rit.edu>
Signed-off-by: Andrew Elble <aweits@rit.edu>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

diff --git a/fs/gfs2/acl.c b/fs/gfs2/acl.c
index 3088e2a..7b31430 100644
--- a/fs/gfs2/acl.c
+++ b/fs/gfs2/acl.c
@@ -73,7 +73,7 @@ int gfs2_set_acl(struct inode *inode, struct posix_acl *acl, int type)
 
 	BUG_ON(name == NULL);
 
-	if (acl->a_count > GFS2_ACL_MAX_ENTRIES(GFS2_SB(inode)))
+	if (acl && acl->a_count > GFS2_ACL_MAX_ENTRIES(GFS2_SB(inode)))
 		return -E2BIG;
 
 	if (type == ACL_TYPE_ACCESS) {
-- 
1.8.3.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-02-10 10:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-10 10:36 [Cluster-devel] GFS2: Pre-pull patch posting Steven Whitehouse
2015-02-10 10:36 ` [Cluster-devel] [PATCH 1/5] GFS2: Eliminate __gfs2_glock_remove_from_lru Steven Whitehouse
2015-02-10 10:36 ` [Cluster-devel] [PATCH 2/5] GFS2: fix sprintf format specifier Steven Whitehouse
2015-02-10 10:36 ` [Cluster-devel] [PATCH 3/5] GFS2: Eliminate a nonsense goto Steven Whitehouse
2015-02-10 10:36 ` [Cluster-devel] [PATCH 4/5] GFS2: use __vmalloc GFP_NOFS for fs-related allocations Steven Whitehouse
2015-02-10 10:36 ` [Cluster-devel] [PATCH 5/5] GFS2: Fix crash during ACL deletion in acl max entry check in gfs2_set_acl() Steven Whitehouse

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).