[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210503204907.34013-11-andriy.shevchenko@linux.intel.com>
Date: Mon, 3 May 2021 23:49:05 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: "J. Bruce Fields" <bfields@...hat.com>,
Kefeng Wang <wangkefeng.wang@...wei.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
linux-kernel@...r.kernel.org, linux-nfs@...r.kernel.org,
linux-fsdevel@...r.kernel.org
Cc: "J. Bruce Fields" <bfields@...ldses.org>,
Chuck Lever <chuck.lever@...cle.com>,
Alexander Viro <viro@...iv.linux.org.uk>,
Andy Shevchenko <andy@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH v1 10/12] nfsd: Avoid non-flexible API in seq_quote_mem()
string_escape_mem_ascii() followed by seq_escape_mem_ascii() is completely
non-flexible and shouldn't be exist from day 1.
Replace it with properly called string_escape_mem().
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
fs/nfsd/nfs4state.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index b517a8794400..15535589e5e4 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2350,8 +2350,14 @@ static struct nfs4_client *get_nfsdfs_clp(struct inode *inode)
static void seq_quote_mem(struct seq_file *m, char *data, int len)
{
+ char *buf;
+ size_t size = seq_get_buf(m, &buf);
+ const char *only = "\"\\";
+ int ret;
+
seq_printf(m, "\"");
- seq_escape_mem_ascii(m, data, len);
+ ret = string_escape_mem(data, len, buf, size, ESCAPE_HEX | ESCAPE_APPEND, only);
+ seq_commit(m, ret < size ? ret : -1);
seq_printf(m, "\"");
}
--
2.30.2
Powered by blists - more mailing lists