Skip to content

Commit

Permalink
GFS2: fix sprintf format specifier
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
alex chen authored and Steven Whitehouse committed Jan 13, 2015
1 parent 8f6cb40 commit 3566c96
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fs/gfs2/recovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion fs/gfs2/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3566c96

Please sign in to comment.