Skip to content

Commit

Permalink
scsi_proc: make proc_scsi_host_open() preallocate a bigger buffer
Browse files Browse the repository at this point in the history
Some of the ->show_info() instances really spew a lot; it's not a problem
wrt correctness (seq_read() will grow buffer and call the sucker again),
but in this case it makes sense to start with a somewhat bigger one -
they often do exceed one page worth of output.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Apr 9, 2013
1 parent 2043f49 commit 859d22f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/scsi/scsi_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ static int proc_scsi_show(struct seq_file *m, void *v)

static int proc_scsi_host_open(struct inode *inode, struct file *file)
{
return single_open(file, proc_scsi_show, PDE(inode)->data);
return single_open_size(file, proc_scsi_show, PDE(inode)->data,
4 * PAGE_SIZE);
}

static const struct file_operations proc_scsi_fops = {
Expand Down

0 comments on commit 859d22f

Please sign in to comment.