mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Fasheh <mfasheh@suse.com>
To: linux-kernel@vger.kernel.org
Cc: Mark Fasheh <mfasheh@suse.com>,
	ocfs2-devel@oss.oracle.com, Joel Becker <joel.becker@oracle.com>
Subject: [PATCH 09/17] ocfs2: Don't snprintf() without a format.
Date: Mon, 14 Jul 2008 15:01:42 -0700	[thread overview]
Message-ID: <1216072910-27226-10-git-send-email-mfasheh@suse.com> (raw)
In-Reply-To: <1216072910-27226-1-git-send-email-mfasheh@suse.com>

From: Joel Becker <joel.becker@oracle.com>

Some system files are per-slot.  Their names include the slot number.
ocfs2_sprintf_system_inode_name() uses the system inode definitions to
fill in the slot number with snprintf().

For global system files, there is no node number, and the name was
printed as a format with no arguments.  -Wformat-nonliteral and
-Wformat-security don't like this.  Instead, use a static "%s" format
and the name as the argument.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
---
 fs/ocfs2/ocfs2_fs.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/ocfs2/ocfs2_fs.h b/fs/ocfs2/ocfs2_fs.h
index 52c4266..3f19451 100644
--- a/fs/ocfs2/ocfs2_fs.h
+++ b/fs/ocfs2/ocfs2_fs.h
@@ -901,7 +901,7 @@ static inline int ocfs2_sprintf_system_inode_name(char *buf, int len,
          * list has a copy per slot.
          */
 	if (type <= OCFS2_LAST_GLOBAL_SYSTEM_INODE)
-		chars = snprintf(buf, len,
+		chars = snprintf(buf, len, "%s",
 				 ocfs2_system_inodes[type].si_name);
 	else
 		chars = snprintf(buf, len,
-- 
1.5.4.1


  parent reply	other threads:[~2008-07-14 22:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-14 22:01 [git patches] Ocfs2 and Configfs updates for 2.6.27 Mark Fasheh
2008-07-14 22:01 ` [PATCH 01/17] ocfs2: Add CONFIG_OCFS2_FS_STATS config option Mark Fasheh
2008-07-14 22:01 ` [PATCH 02/17] ocfs2: Instrument fs cluster locks Mark Fasheh
2008-07-14 22:01 ` [PATCH 03/17] ocfs2: fix printk format warnings with OCFS2_FS_STATS=n Mark Fasheh
2008-07-14 22:01 ` [PATCH 04/17] ocfs2: use simple_read_from_buffer() Mark Fasheh
2008-07-14 22:01 ` [PATCH 05/17] ocfs2: Silence an error message in ocfs2_file_aio_read() Mark Fasheh
2008-07-14 22:01 ` [PATCH 06/17] ocfs2: Handle error during journal load Mark Fasheh
2008-07-14 22:01 ` [PATCH 07/17] ocfs2/net: Silence build warnings on sparc64 Mark Fasheh
2008-07-14 22:01 ` [PATCH 08/17] ocfs2: Fix CONFIG_OCFS2_DEBUG_FS #ifdefs Mark Fasheh
2008-07-14 22:01 ` Mark Fasheh [this message]
2008-07-14 22:01 ` [PATCH 10/17] configfs: Introduce configfs_dirent_lock Mark Fasheh
2008-07-14 22:01 ` [PATCH 11/17] configfs: Protect configfs_dirent s_links list mutations Mark Fasheh
2008-07-14 22:01 ` [PATCH 12/17] configfs: Make configfs_new_dirent() return error code instead of NULL Mark Fasheh
2008-07-14 22:01 ` [PATCH 13/17] configfs: Fix deadlock with racing rmdir() and rename() Mark Fasheh
2008-07-14 22:01 ` [PATCH 14/17] configfs: Fix failing mkdir() making racing rmdir() fail Mark Fasheh
2008-07-14 22:01 ` [PATCH 15/17] configfs: Allow ->make_item() and ->make_group() to return detailed errors Mark Fasheh
2008-07-14 22:01 ` [PATCH 16/17] configfs: call drop_link() to cleanup after create_link() failure Mark Fasheh
2008-07-14 22:01 ` [PATCH 17/17] [PATCH] ocfs2: fix oops in mmap_truncate testing Mark Fasheh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1216072910-27226-10-git-send-email-mfasheh@suse.com \
    --to=mfasheh@suse.com \
    --cc=joel.becker@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ocfs2-devel@oss.oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®