Skip to content

Commit 713dd15

Browse files
gtmothjfvogel
authored andcommitted
Reapply "ocfs2: fix sparse warnings"
This reverts commit e012238. Upstream now has the fix, hence reapplying so that the fix can be applied on top. Orabug: 38041352 Signed-off-by: Gautham Ananthakrishna <[email protected]> Reviewed-by: Mark Tinguely <[email protected]>
1 parent 143d366 commit 713dd15

File tree

5 files changed

+16
-15
lines changed

5 files changed

+16
-15
lines changed

fs/ocfs2/dlm/dlmdomain.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,7 +1276,7 @@ static int dlm_query_nodeinfo_handler(struct o2net_msg *msg, u32 len,
12761276
{
12771277
struct dlm_query_nodeinfo *qn;
12781278
struct dlm_ctxt *dlm = NULL;
1279-
int locked = 0, status = -EINVAL;
1279+
int status = -EINVAL;
12801280

12811281
qn = (struct dlm_query_nodeinfo *) msg->buf;
12821282

@@ -1292,12 +1292,11 @@ static int dlm_query_nodeinfo_handler(struct o2net_msg *msg, u32 len,
12921292
}
12931293

12941294
spin_lock(&dlm->spinlock);
1295-
locked = 1;
12961295
if (dlm->joining_node != qn->qn_nodenum) {
12971296
mlog(ML_ERROR, "Node %d queried nodes on domain %s but "
12981297
"joining node is %d\n", qn->qn_nodenum, qn->qn_domain,
12991298
dlm->joining_node);
1300-
goto bail;
1299+
goto unlock;
13011300
}
13021301

13031302
/* Support for node query was added in 1.1 */
@@ -1307,14 +1306,14 @@ static int dlm_query_nodeinfo_handler(struct o2net_msg *msg, u32 len,
13071306
"but active dlm protocol is %d.%d\n", qn->qn_nodenum,
13081307
qn->qn_domain, dlm->dlm_locking_proto.pv_major,
13091308
dlm->dlm_locking_proto.pv_minor);
1310-
goto bail;
1309+
goto unlock;
13111310
}
13121311

13131312
status = dlm_match_nodes(dlm, qn);
13141313

1314+
unlock:
1315+
spin_unlock(&dlm->spinlock);
13151316
bail:
1316-
if (locked)
1317-
spin_unlock(&dlm->spinlock);
13181317
spin_unlock(&dlm_domain_lock);
13191318

13201319
return status;

fs/ocfs2/export.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,9 @@ static struct dentry *ocfs2_fh_to_dentry(struct super_block *sb,
255255
if (fh_len < 3 || fh_type > 2)
256256
return NULL;
257257

258-
handle.ih_blkno = (u64)le32_to_cpu(fid->raw[0]) << 32;
259-
handle.ih_blkno |= (u64)le32_to_cpu(fid->raw[1]);
260-
handle.ih_generation = le32_to_cpu(fid->raw[2]);
258+
handle.ih_blkno = (u64)le32_to_cpu((__force __le32)fid->raw[0]) << 32;
259+
handle.ih_blkno |= (u64)le32_to_cpu((__force __le32)fid->raw[1]);
260+
handle.ih_generation = le32_to_cpu((__force __le32)fid->raw[2]);
261261
return ocfs2_get_dentry(sb, &handle);
262262
}
263263

@@ -269,9 +269,9 @@ static struct dentry *ocfs2_fh_to_parent(struct super_block *sb,
269269
if (fh_type != 2 || fh_len < 6)
270270
return NULL;
271271

272-
parent.ih_blkno = (u64)le32_to_cpu(fid->raw[3]) << 32;
273-
parent.ih_blkno |= (u64)le32_to_cpu(fid->raw[4]);
274-
parent.ih_generation = le32_to_cpu(fid->raw[5]);
272+
parent.ih_blkno = (u64)le32_to_cpu((__force __le32)fid->raw[3]) << 32;
273+
parent.ih_blkno |= (u64)le32_to_cpu((__force __le32)fid->raw[4]);
274+
parent.ih_generation = le32_to_cpu((__force __le32)fid->raw[5]);
275275
return ocfs2_get_dentry(sb, &parent);
276276
}
277277

fs/ocfs2/inode.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,13 +1621,15 @@ static struct super_block *ocfs2_inode_cache_get_super(struct ocfs2_caching_info
16211621
}
16221622

16231623
static void ocfs2_inode_cache_lock(struct ocfs2_caching_info *ci)
1624+
__acquires(&oi->ip_lock)
16241625
{
16251626
struct ocfs2_inode_info *oi = cache_info_to_inode(ci);
16261627

16271628
spin_lock(&oi->ip_lock);
16281629
}
16291630

16301631
static void ocfs2_inode_cache_unlock(struct ocfs2_caching_info *ci)
1632+
__releases(&oi->ip_lock)
16311633
{
16321634
struct ocfs2_inode_info *oi = cache_info_to_inode(ci);
16331635

fs/ocfs2/localalloc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ int ocfs2_load_local_alloc(struct ocfs2_super *osb)
336336
"found = %u, set = %u, taken = %u, off = %u\n",
337337
num_used, le32_to_cpu(alloc->id1.bitmap1.i_used),
338338
le32_to_cpu(alloc->id1.bitmap1.i_total),
339-
OCFS2_LOCAL_ALLOC(alloc)->la_bm_off);
339+
le32_to_cpu(OCFS2_LOCAL_ALLOC(alloc)->la_bm_off));
340340

341341
status = -EINVAL;
342342
goto bail;
@@ -1216,7 +1216,7 @@ static int ocfs2_local_alloc_new_window(struct ocfs2_super *osb,
12161216
OCFS2_LOCAL_ALLOC(alloc)->la_bitmap);
12171217

12181218
trace_ocfs2_local_alloc_new_window_result(
1219-
OCFS2_LOCAL_ALLOC(alloc)->la_bm_off,
1219+
le32_to_cpu(OCFS2_LOCAL_ALLOC(alloc)->la_bm_off),
12201220
le32_to_cpu(alloc->id1.bitmap1.i_total));
12211221

12221222
bail:

fs/ocfs2/refcounttree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ static int ocfs2_create_refcount_tree(struct inode *inode,
631631
rb->rf_records.rl_count =
632632
cpu_to_le16(ocfs2_refcount_recs_per_rb(osb->sb));
633633
spin_lock(&osb->osb_lock);
634-
rb->rf_generation = osb->s_next_generation++;
634+
rb->rf_generation = cpu_to_le32(osb->s_next_generation++);
635635
spin_unlock(&osb->osb_lock);
636636

637637
ocfs2_journal_dirty(handle, new_bh);

0 commit comments

Comments
 (0)