Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2: [PATCH] ocfs2: fix oops in mmap_truncate testing configfs: call drop_link() to cleanup after create_link() failure configfs: Allow ->make_item() and ->make_group() to return detailed errors. configfs: Fix failing mkdir() making racing rmdir() fail configfs: Fix deadlock with racing rmdir() and rename() configfs: Make configfs_new_dirent() return error code instead of NULL configfs: Protect configfs_dirent s_links list mutations configfs: Introduce configfs_dirent_lock ocfs2: Don't snprintf() without a format. ocfs2: Fix CONFIG_OCFS2_DEBUG_FS #ifdefs ocfs2/net: Silence build warnings on sparc64 ocfs2: Handle error during journal load ocfs2: Silence an error message in ocfs2_file_aio_read() ocfs2: use simple_read_from_buffer() ocfs2: fix printk format warnings with OCFS2_FS_STATS=n [PATCH 2/2] ocfs2: Instrument fs cluster locks [PATCH 1/2] ocfs2: Add CONFIG_OCFS2_FS_STATS config option
This commit is contained in:
@ -550,26 +550,17 @@ static ssize_t ocfs2_control_read(struct file *file,
|
||||
size_t count,
|
||||
loff_t *ppos)
|
||||
{
|
||||
char *proto_string = OCFS2_CONTROL_PROTO;
|
||||
size_t to_write = 0;
|
||||
ssize_t ret;
|
||||
|
||||
if (*ppos >= OCFS2_CONTROL_PROTO_LEN)
|
||||
return 0;
|
||||
|
||||
to_write = OCFS2_CONTROL_PROTO_LEN - *ppos;
|
||||
if (to_write > count)
|
||||
to_write = count;
|
||||
if (copy_to_user(buf, proto_string + *ppos, to_write))
|
||||
return -EFAULT;
|
||||
|
||||
*ppos += to_write;
|
||||
ret = simple_read_from_buffer(buf, count, ppos,
|
||||
OCFS2_CONTROL_PROTO, OCFS2_CONTROL_PROTO_LEN);
|
||||
|
||||
/* Have we read the whole protocol list? */
|
||||
if (*ppos >= OCFS2_CONTROL_PROTO_LEN)
|
||||
if (ret > 0 && *ppos >= OCFS2_CONTROL_PROTO_LEN)
|
||||
ocfs2_control_set_handshake_state(file,
|
||||
OCFS2_CONTROL_HANDSHAKE_READ);
|
||||
|
||||
return to_write;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int ocfs2_control_release(struct inode *inode, struct file *file)
|
||||
|
Reference in New Issue
Block a user