Merge part of branch 'for-next.instantiate' into for-next
authorAndreas Gruenbacher <agruenba@redhat.com>
Fri, 5 Aug 2022 16:37:03 +0000 (18:37 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Fri, 5 Aug 2022 16:37:03 +0000 (18:37 +0200)
fs/gfs2/dir.c
fs/gfs2/file.c
fs/gfs2/glock.c
fs/gfs2/lock_dlm.c
fs/gfs2/rgrp.c
fs/gfs2/rgrp.h
fs/gfs2/xattr.c

index 42b7dfffb5e7eba43e485a0fd5e888453f87f547..df938b8c8359c8c4e95e7faca4e9545abfebd34d 100644 (file)
@@ -2017,7 +2017,7 @@ static int leaf_dealloc(struct gfs2_inode *dip, u32 index, u32 len,
                l_blocks++;
        }
 
-       gfs2_rlist_alloc(&rlist);
+       gfs2_rlist_alloc(&rlist, LM_ST_EXCLUSIVE, LM_FLAG_NODE_SCOPE);
 
        for (x = 0; x < rlist.rl_rgrps; x++) {
                struct gfs2_rgrpd *rgd = gfs2_glock2rgrp(rlist.rl_ghs[x].gh_gl);
index 2cceb193dcd85f029023293ecc0cc6602576958a..d8f1239344c1f708fab98eb8ea5e587e6b090398 100644 (file)
@@ -1066,8 +1066,7 @@ out_unlock:
                gfs2_glock_dq(gh);
 out_uninit:
        gfs2_holder_uninit(gh);
-       if (statfs_gh)
-               kfree(statfs_gh);
+       kfree(statfs_gh);
        from->count = orig_count - written;
        return written ? written : ret;
 }
index e79f17d6d001f2bca6e43a9cb608e25432b37aaf..0b36a16659b625d5cbfb8b6c24151cc1f5314693 100644 (file)
@@ -543,9 +543,10 @@ static int do_promote(struct gfs2_glock *gl)
                        continue;
                if (!may_grant(gl, current_gh, gh)) {
                        /*
-                        * If we get here, it means we may not grant this holder for
-                        * some reason. If this holder is the head of the list, it
-                        * means we have a blocked holder at the head, so return 1.
+                        * If we get here, it means we may not grant this
+                        * holder for some reason. If this holder is at the
+                        * head of the list, it means we have a blocked holder
+                        * at the head, so return 1.
                         */
                        if (list_is_first(&gh->gh_list, &gl->gl_holders))
                                return 1;
@@ -1750,7 +1751,7 @@ static int glock_compare(const void *arg_a, const void *arg_b)
 }
 
 /**
- * nq_m_sync - synchonously acquire more than one glock in deadlock free order
+ * nq_m_sync - synchronously acquire more than one glock in deadlock free order
  * @num_gh: the number of structures
  * @ghs: an array of struct gfs2_holder structures
  * @p: placeholder for the holder structure to pass back
@@ -1771,8 +1772,6 @@ static int nq_m_sync(unsigned int num_gh, struct gfs2_holder *ghs,
        sort(p, num_gh, sizeof(struct gfs2_holder *), glock_compare, NULL);
 
        for (x = 0; x < num_gh; x++) {
-               p[x]->gh_flags &= ~(LM_FLAG_TRY | GL_ASYNC);
-
                error = gfs2_glock_nq(p[x]);
                if (error) {
                        while (x--)
@@ -1789,7 +1788,6 @@ static int nq_m_sync(unsigned int num_gh, struct gfs2_holder *ghs,
  * @num_gh: the number of structures
  * @ghs: an array of struct gfs2_holder structures
  *
- *
  * Returns: 0 on success (all glocks acquired),
  *          errno on failure (no glocks acquired)
  */
@@ -1804,7 +1802,6 @@ int gfs2_glock_nq_m(unsigned int num_gh, struct gfs2_holder *ghs)
        case 0:
                return 0;
        case 1:
-               ghs->gh_flags &= ~(LM_FLAG_TRY | GL_ASYNC);
                return gfs2_glock_nq(ghs);
        default:
                if (num_gh <= 4)
index 2559a79cf14beaab1960fd3aeb08abcb67b9a61a..6ce369b096d4b633964d617d22fa02163c142617 100644 (file)
@@ -1058,7 +1058,7 @@ restart:
 
 /*
  * Expand static jid arrays if necessary (by increments of RECOVER_SIZE_INC)
- * to accomodate the largest slot number.  (NB dlm slot numbers start at 1,
+ * to accommodate the largest slot number.  (NB dlm slot numbers start at 1,
  * gfs2 jids start at 0, so jid = slot - 1)
  */
 
index 5439bad3083ef2ad6551360d39b4b948b50adfb2..f602fb844951935c93b55e2ab1afac27fc2e6637 100644 (file)
@@ -2719,12 +2719,15 @@ void gfs2_rlist_add(struct gfs2_inode *ip, struct gfs2_rgrp_list *rlist,
  * gfs2_rlist_alloc - all RGs have been added to the rlist, now allocate
  *      and initialize an array of glock holders for them
  * @rlist: the list of resource groups
+ * @state: the state we're requesting
+ * @flags: the modifier flags
  *
  * FIXME: Don't use NOFAIL
  *
  */
 
-void gfs2_rlist_alloc(struct gfs2_rgrp_list *rlist)
+void gfs2_rlist_alloc(struct gfs2_rgrp_list *rlist,
+                     unsigned int state, u16 flags)
 {
        unsigned int x;
 
@@ -2732,8 +2735,8 @@ void gfs2_rlist_alloc(struct gfs2_rgrp_list *rlist)
                                      sizeof(struct gfs2_holder),
                                      GFP_NOFS | __GFP_NOFAIL);
        for (x = 0; x < rlist->rl_rgrps; x++)
-               gfs2_holder_init(rlist->rl_rgd[x]->rd_gl, LM_ST_EXCLUSIVE,
-                                LM_FLAG_NODE_SCOPE, &rlist->rl_ghs[x]);
+               gfs2_holder_init(rlist->rl_rgd[x]->rd_gl, state, flags,
+                                &rlist->rl_ghs[x]);
 }
 
 /**
index c75bac45d31428e59bd577dbd96a2fa55ee80443..00b30cf893af238ac4be1b970b234c8b27773e03 100644 (file)
@@ -64,7 +64,8 @@ struct gfs2_rgrp_list {
 
 extern void gfs2_rlist_add(struct gfs2_inode *ip, struct gfs2_rgrp_list *rlist,
                           u64 block);
-extern void gfs2_rlist_alloc(struct gfs2_rgrp_list *rlist);
+extern void gfs2_rlist_alloc(struct gfs2_rgrp_list *rlist,
+                            unsigned int state, u16 flags);
 extern void gfs2_rlist_free(struct gfs2_rgrp_list *rlist);
 extern u64 gfs2_ri_total(struct gfs2_sbd *sdp);
 extern void gfs2_rgrp_dump(struct seq_file *seq, struct gfs2_rgrpd *rgd,
index 0c5650fe1fd1823ec8ef6bd3207397fd63153512..f6a66050380e9d07b121eceb3f565cbfed832ec5 100644 (file)
@@ -1313,7 +1313,7 @@ static int ea_dealloc_indirect(struct gfs2_inode *ip)
        else
                goto out;
 
-       gfs2_rlist_alloc(&rlist);
+       gfs2_rlist_alloc(&rlist, LM_ST_EXCLUSIVE, LM_FLAG_NODE_SCOPE);
 
        for (x = 0; x < rlist.rl_rgrps; x++) {
                rgd = gfs2_glock2rgrp(rlist.rl_ghs[x].gh_gl);