Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80619
b: refs/heads/master
c: 2a79289
h: refs/heads/master
i:
  80617: 35f9a1d
  80615: 63d5514
v: v3
  • Loading branch information
Patrick Caulfeld authored and David Teigland committed Jan 30, 2008
1 parent cd2c1bc commit 4263622
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 85f0379aa0f9366bb6918e2e898a915231176fbd
refs/heads/master: 2a79289e87f3b6487b5fd23c8569f32097057fb4
12 changes: 9 additions & 3 deletions trunk/fs/dlm/user.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ struct dlm_lock_result32 {
};

static void compat_input(struct dlm_write_request *kb,
struct dlm_write_request32 *kb32)
struct dlm_write_request32 *kb32,
int max_namelen)
{
kb->version[0] = kb32->version[0];
kb->version[1] = kb32->version[1];
Expand Down Expand Up @@ -112,7 +113,11 @@ static void compat_input(struct dlm_write_request *kb,
kb->i.lock.bastaddr = (void *)(long)kb32->i.lock.bastaddr;
kb->i.lock.lksb = (void *)(long)kb32->i.lock.lksb;
memcpy(kb->i.lock.lvb, kb32->i.lock.lvb, DLM_USER_LVB_LEN);
memcpy(kb->i.lock.name, kb32->i.lock.name, kb->i.lock.namelen);
if (kb->i.lock.namelen <= max_namelen)
memcpy(kb->i.lock.name, kb32->i.lock.name,
kb->i.lock.namelen);
else
kb->i.lock.namelen = max_namelen;
}
}

Expand Down Expand Up @@ -529,7 +534,8 @@ static ssize_t device_write(struct file *file, const char __user *buf,

if (proc)
set_bit(DLM_PROC_FLAGS_COMPAT, &proc->flags);
compat_input(kbuf, k32buf);
compat_input(kbuf, k32buf,
count - sizeof(struct dlm_write_request32));
kfree(k32buf);
}
#endif
Expand Down

0 comments on commit 4263622

Please sign in to comment.