Skip to content

Commit 1151935

Browse files
Alexander Aringteigland
authored andcommitted
fs: dlm: constify receive buffer
The dlm receive buffer should be never manipulated as DLM is the last instance of parsing layer. This patch constify the whole receive buffer so we are sure it never gets manipulated when it's being parsed. Signed-off-by: Alexander Aring <[email protected]> Signed-off-by: David Teigland <[email protected]>
1 parent b9d2f6a commit 1151935

File tree

13 files changed

+101
-86
lines changed

13 files changed

+101
-86
lines changed

fs/dlm/dir.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ int dlm_recover_directory(struct dlm_ls *ls, uint64_t seq)
196196
return error;
197197
}
198198

199-
static struct dlm_rsb *find_rsb_root(struct dlm_ls *ls, char *name, int len)
199+
static struct dlm_rsb *find_rsb_root(struct dlm_ls *ls, const char *name,
200+
int len)
200201
{
201202
struct dlm_rsb *r;
202203
uint32_t hash, bucket;
@@ -232,7 +233,7 @@ static struct dlm_rsb *find_rsb_root(struct dlm_ls *ls, char *name, int len)
232233
for rsb's we're master of and whose directory node matches the requesting
233234
node. inbuf is the rsb name last sent, inlen is the name's length */
234235

235-
void dlm_copy_master_names(struct dlm_ls *ls, char *inbuf, int inlen,
236+
void dlm_copy_master_names(struct dlm_ls *ls, const char *inbuf, int inlen,
236237
char *outbuf, int outlen, int nodeid)
237238
{
238239
struct list_head *list;

fs/dlm/dir.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ int dlm_dir_nodeid(struct dlm_rsb *rsb);
1616
int dlm_hash2nodeid(struct dlm_ls *ls, uint32_t hash);
1717
void dlm_recover_dir_nodeid(struct dlm_ls *ls);
1818
int dlm_recover_directory(struct dlm_ls *ls, uint64_t seq);
19-
void dlm_copy_master_names(struct dlm_ls *ls, char *inbuf, int inlen,
20-
char *outbuf, int outlen, int nodeid);
19+
void dlm_copy_master_names(struct dlm_ls *ls, const char *inbuf, int inlen,
20+
char *outbuf, int outlen, int nodeid);
2121

2222
#endif /* __DIR_DOT_H__ */
2323

0 commit comments

Comments
 (0)