aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jbd2/journal.c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2008-05-12 17:02:33 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-05-13 11:02:26 -0400
commitf36f21ecca9ee688301174e5f2e0827827a7a7ff (patch)
treeb147bb5cc37683dfe01c86fba634808aa2ff567d /fs/jbd2/journal.c
parent78bb6cb9a890d3d50ca3b02fce9223d3e734ab9b (diff)
Fix misuses of bdevname()
bdevname() fills the buffer that it is given as a parameter, so calling strcpy() or snprintf() on the returned value is redundant (and probably not guaranteed to work - I don't think strcpy and snprintf support overlapping buffers.) Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Stephen Tweedie <sct@redhat.com> Cc: Jens Axboe <axboe@kernel.dk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/jbd2/journal.c')
-rw-r--r--fs/jbd2/journal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index 53632e3e8457..2e24567c4a79 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -901,7 +901,7 @@ static void jbd2_stats_proc_init(journal_t *journal)
901{ 901{
902 char name[BDEVNAME_SIZE]; 902 char name[BDEVNAME_SIZE];
903 903
904 snprintf(name, sizeof(name) - 1, "%s", bdevname(journal->j_dev, name)); 904 bdevname(journal->j_dev, name);
905 journal->j_proc_entry = proc_mkdir(name, proc_jbd2_stats); 905 journal->j_proc_entry = proc_mkdir(name, proc_jbd2_stats);
906 if (journal->j_proc_entry) { 906 if (journal->j_proc_entry) {
907 proc_create_data("history", S_IRUGO, journal->j_proc_entry, 907 proc_create_data("history", S_IRUGO, journal->j_proc_entry,
@@ -915,7 +915,7 @@ static void jbd2_stats_proc_exit(journal_t *journal)
915{ 915{
916 char name[BDEVNAME_SIZE]; 916 char name[BDEVNAME_SIZE];
917 917
918 snprintf(name, sizeof(name) - 1, "%s", bdevname(journal->j_dev, name)); 918 bdevname(journal->j_dev, name);
919 remove_proc_entry("info", journal->j_proc_entry); 919 remove_proc_entry("info", journal->j_proc_entry);
920 remove_proc_entry("history", journal->j_proc_entry); 920 remove_proc_entry("history", journal->j_proc_entry);
921 remove_proc_entry(name, proc_jbd2_stats); 921 remove_proc_entry(name, proc_jbd2_stats);