aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-11-22 11:13:21 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2006-11-30 10:36:33 -0500
commit28626e2078571c4b776a17eaa486bbd2b7dfe2cd (patch)
tree7baa910604078685266ebc023121a536b0931b88 /fs
parent1a14d3a68f04527546121eb7b45187ff6af63151 (diff)
[GFS2] Fix glock ordering on inode creation
The lock order here should be parent -> child rather than numeric order. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/gfs2/inode.c31
1 files changed, 4 insertions, 27 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index ce7f8330690..d122074c45e 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -870,33 +870,10 @@ struct inode *gfs2_createi(struct gfs2_holder *ghs, const struct qstr *name,
870 if (error) 870 if (error)
871 goto fail_gunlock; 871 goto fail_gunlock;
872 872
873 if (inum.no_addr < dip->i_num.no_addr) { 873 error = gfs2_glock_nq_num(sdp, inum.no_addr, &gfs2_inode_glops,
874 gfs2_glock_dq(ghs); 874 LM_ST_EXCLUSIVE, GL_SKIP, ghs + 1);
875 875 if (error)
876 error = gfs2_glock_nq_num(sdp, inum.no_addr, 876 goto fail_gunlock;
877 &gfs2_inode_glops, LM_ST_EXCLUSIVE,
878 GL_SKIP, ghs + 1);
879 if (error) {
880 return ERR_PTR(error);
881 }
882
883 gfs2_holder_reinit(LM_ST_EXCLUSIVE, 0, ghs);
884 error = gfs2_glock_nq(ghs);
885 if (error) {
886 gfs2_glock_dq_uninit(ghs + 1);
887 return ERR_PTR(error);
888 }
889
890 error = create_ok(dip, name, mode);
891 if (error)
892 goto fail_gunlock2;
893 } else {
894 error = gfs2_glock_nq_num(sdp, inum.no_addr,
895 &gfs2_inode_glops, LM_ST_EXCLUSIVE,
896 GL_SKIP, ghs + 1);
897 if (error)
898 goto fail_gunlock;
899 }
900 877
901 error = make_dinode(dip, ghs[1].gh_gl, mode, &inum, &generation, dev); 878 error = make_dinode(dip, ghs[1].gh_gl, mode, &inum, &generation, dev);
902 if (error) 879 if (error)