]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[DLM] use snprintf in sysfs show
authorDavid Teigland <teigland@redhat.com>
Wed, 6 Sep 2006 22:01:40 +0000 (17:01 -0500)
committerSteven Whitehouse <swhiteho@redhat.com>
Thu, 7 Sep 2006 13:44:01 +0000 (09:44 -0400)
Use snprintf(buf, PAGE_SIZE, ...) instead of sprintf in sysfs show
methods.

Signed-off-by: David Teigland <teigland@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/dlm/lockspace.c

index ff83f80e43eb4aafbde8559e343dfa2e08f45e18..109333c8ecb9136cd09cd3b87ae4ec3b2d68f015 100644 (file)
@@ -66,7 +66,7 @@ static ssize_t dlm_event_store(struct dlm_ls *ls, const char *buf, size_t len)
 
 static ssize_t dlm_id_show(struct dlm_ls *ls, char *buf)
 {
-       return sprintf(buf, "%u\n", ls->ls_global_id);
+       return snprintf(buf, PAGE_SIZE, "%u\n", ls->ls_global_id);
 }
 
 static ssize_t dlm_id_store(struct dlm_ls *ls, const char *buf, size_t len)
@@ -78,12 +78,12 @@ static ssize_t dlm_id_store(struct dlm_ls *ls, const char *buf, size_t len)
 static ssize_t dlm_recover_status_show(struct dlm_ls *ls, char *buf)
 {
        uint32_t status = dlm_recover_status(ls);
-       return sprintf(buf, "%x\n", status);
+       return snprintf(buf, PAGE_SIZE, "%x\n", status);
 }
 
 static ssize_t dlm_recover_nodeid_show(struct dlm_ls *ls, char *buf)
 {
-       return sprintf(buf, "%d\n", ls->ls_recover_nodeid);
+       return snprintf(buf, PAGE_SIZE, "%d\n", ls->ls_recover_nodeid);
 }
 
 struct dlm_attr {