aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-02-10 19:20:49 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-10 19:20:49 -0500
commitb2718bffb4088faf13092db30c1ebf088ddee52e (patch)
tree445160f6449c9639b0f0f1bf2cd0f59093f73602 /fs
parentae90fb14206efda2c2ea6d61e14f14bf0132f676 (diff)
parent278702074ff77b1a3fa2061267997095959f5e2c (diff)
Merge tag 'gfs2-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-3.0-nmw
Pull gfs2 updates from Steven Whitehouse: "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" * tag 'gfs2-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-3.0-nmw: GFS2: Fix crash during ACL deletion in acl max entry check in gfs2_set_acl() GFS2: use __vmalloc GFP_NOFS for fs-related allocations. GFS2: Eliminate a nonsense goto GFS2: fix sprintf format specifier GFS2: Eliminate __gfs2_glock_remove_from_lru
Diffstat (limited to 'fs')
-rw-r--r--fs/gfs2/acl.c2
-rw-r--r--fs/gfs2/dir.c3
-rw-r--r--fs/gfs2/glock.c13
-rw-r--r--fs/gfs2/inode.c3
-rw-r--r--fs/gfs2/recovery.c2
-rw-r--r--fs/gfs2/sys.c2
6 files changed, 8 insertions, 17 deletions
diff --git a/fs/gfs2/acl.c b/fs/gfs2/acl.c
index 3088e2a38e30..7b3143064af1 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)
73 73
74 BUG_ON(name == NULL); 74 BUG_ON(name == NULL);
75 75
76 if (acl->a_count > GFS2_ACL_MAX_ENTRIES(GFS2_SB(inode))) 76 if (acl && acl->a_count > GFS2_ACL_MAX_ENTRIES(GFS2_SB(inode)))
77 return -E2BIG; 77 return -E2BIG;
78 78
79 if (type == ACL_TYPE_ACCESS) { 79 if (type == ACL_TYPE_ACCESS) {
diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c
index c5a34f09e228..6371192961e2 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,
1896 1896
1897 ht = kzalloc(size, GFP_NOFS | __GFP_NOWARN); 1897 ht = kzalloc(size, GFP_NOFS | __GFP_NOWARN);
1898 if (ht == NULL) 1898 if (ht == NULL)
1899 ht = vzalloc(size); 1899 ht = __vmalloc(size, GFP_NOFS | __GFP_NOWARN | __GFP_ZERO,
1900 PAGE_KERNEL);
1900 if (!ht) 1901 if (!ht)
1901 return -ENOMEM; 1902 return -ENOMEM;
1902 1903
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index a23524aa3eac..aeb7bc958a18 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)
173 spin_unlock(&lru_lock); 173 spin_unlock(&lru_lock);
174} 174}
175 175
176static void __gfs2_glock_remove_from_lru(struct gfs2_glock *gl) 176static void gfs2_glock_remove_from_lru(struct gfs2_glock *gl)
177{ 177{
178 spin_lock(&lru_lock);
178 if (!list_empty(&gl->gl_lru)) { 179 if (!list_empty(&gl->gl_lru)) {
179 list_del_init(&gl->gl_lru); 180 list_del_init(&gl->gl_lru);
180 atomic_dec(&lru_count); 181 atomic_dec(&lru_count);
181 clear_bit(GLF_LRU, &gl->gl_flags); 182 clear_bit(GLF_LRU, &gl->gl_flags);
182 } 183 }
183}
184
185static void gfs2_glock_remove_from_lru(struct gfs2_glock *gl)
186{
187 spin_lock(&lru_lock);
188 __gfs2_glock_remove_from_lru(gl);
189 spin_unlock(&lru_lock); 184 spin_unlock(&lru_lock);
190} 185}
191 186
@@ -205,9 +200,7 @@ void gfs2_glock_put(struct gfs2_glock *gl)
205 200
206 lockref_mark_dead(&gl->gl_lockref); 201 lockref_mark_dead(&gl->gl_lockref);
207 202
208 spin_lock(&lru_lock); 203 gfs2_glock_remove_from_lru(gl);
209 __gfs2_glock_remove_from_lru(gl);
210 spin_unlock(&lru_lock);
211 spin_unlock(&gl->gl_lockref.lock); 204 spin_unlock(&gl->gl_lockref.lock);
212 spin_lock_bucket(gl->gl_hash); 205 spin_lock_bucket(gl->gl_hash);
213 hlist_bl_del_rcu(&gl->gl_list); 206 hlist_bl_del_rcu(&gl->gl_list);
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 9054002ebe70..73c72253faac 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,
543 } 543 }
544 544
545 error = gfs2_dir_add(&dip->i_inode, name, ip, da); 545 error = gfs2_dir_add(&dip->i_inode, name, ip, da);
546 if (error)
547 goto fail_end_trans;
548 546
549fail_end_trans:
550 gfs2_trans_end(sdp); 547 gfs2_trans_end(sdp);
551fail_ipreserv: 548fail_ipreserv:
552 gfs2_inplace_release(dip); 549 gfs2_inplace_release(dip);
diff --git a/fs/gfs2/recovery.c b/fs/gfs2/recovery.c
index 573bd3b758fa..1b645773c98e 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,
439 439
440 ls->ls_recover_jid_done = jid; 440 ls->ls_recover_jid_done = jid;
441 ls->ls_recover_jid_status = message; 441 ls->ls_recover_jid_status = message;
442 sprintf(env_jid, "JID=%d", jid); 442 sprintf(env_jid, "JID=%u", jid);
443 sprintf(env_status, "RECOVERY=%s", 443 sprintf(env_status, "RECOVERY=%s",
444 message == LM_RD_SUCCESS ? "Done" : "Failed"); 444 message == LM_RD_SUCCESS ? "Done" : "Failed");
445 kobject_uevent_env(&sdp->sd_kobj, KOBJ_CHANGE, envp); 445 kobject_uevent_env(&sdp->sd_kobj, KOBJ_CHANGE, envp);
diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c
index 3ab566ba5696..ae8e8811f0e8 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)
96 struct super_block *sb = sdp->sd_vfs; 96 struct super_block *sb = sdp->sd_vfs;
97 int frozen = (sb->s_writers.frozen == SB_UNFROZEN) ? 0 : 1; 97 int frozen = (sb->s_writers.frozen == SB_UNFROZEN) ? 0 : 1;
98 98
99 return snprintf(buf, PAGE_SIZE, "%u\n", frozen); 99 return snprintf(buf, PAGE_SIZE, "%d\n", frozen);
100} 100}
101 101
102static ssize_t freeze_store(struct gfs2_sbd *sdp, const char *buf, size_t len) 102static ssize_t freeze_store(struct gfs2_sbd *sdp, const char *buf, size_t len)