* [patch] configfs: use capped length for ->store_attribute()
@ 2013-04-30 7:28 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2013-04-30 7:28 UTC (permalink / raw)
To: Joel Becker; +Cc: linux-kernel, kernel-janitors
The difference between "count" and "len" is that "len" is capped at
4095. Changing it like this makes it match how sysfs_write_file() is
implemented.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
This is a static analysis patch. I haven't found any store_attribute()
functions where this change makes a difference.
diff --git a/fs/configfs/file.c b/fs/configfs/file.c
index 2b6cb23..1d1c41f 100644
--- a/fs/configfs/file.c
+++ b/fs/configfs/file.c
@@ -203,7 +203,7 @@ configfs_write_file(struct file *file, const char __user *buf, size_t count, lof
mutex_lock(&buffer->mutex);
len = fill_write_buffer(buffer, buf, count);
if (len > 0)
- len = flush_write_buffer(file->f_path.dentry, buffer, count);
+ len = flush_write_buffer(file->f_path.dentry, buffer, len);
if (len > 0)
*ppos += len;
mutex_unlock(&buffer->mutex);
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [patch] configfs: use capped length for ->store_attribute()
@ 2013-04-30 7:28 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2013-04-30 7:28 UTC (permalink / raw)
To: Joel Becker; +Cc: linux-kernel, kernel-janitors
The difference between "count" and "len" is that "len" is capped at
4095. Changing it like this makes it match how sysfs_write_file() is
implemented.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
This is a static analysis patch. I haven't found any store_attribute()
functions where this change makes a difference.
diff --git a/fs/configfs/file.c b/fs/configfs/file.c
index 2b6cb23..1d1c41f 100644
--- a/fs/configfs/file.c
+++ b/fs/configfs/file.c
@@ -203,7 +203,7 @@ configfs_write_file(struct file *file, const char __user *buf, size_t count, lof
mutex_lock(&buffer->mutex);
len = fill_write_buffer(buffer, buf, count);
if (len > 0)
- len = flush_write_buffer(file->f_path.dentry, buffer, count);
+ len = flush_write_buffer(file->f_path.dentry, buffer, len);
if (len > 0)
*ppos += len;
mutex_unlock(&buffer->mutex);
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [patch] configfs: use capped length for ->store_attribute()
2013-04-30 7:28 ` Dan Carpenter
@ 2013-05-02 21:51 ` Joel Becker
-1 siblings, 0 replies; 6+ messages in thread
From: Joel Becker @ 2013-05-02 21:51 UTC (permalink / raw)
To: Dan Carpenter; +Cc: linux-kernel, kernel-janitors
On Tue, Apr 30, 2013 at 10:28:14AM +0300, Dan Carpenter wrote:
> The difference between "count" and "len" is that "len" is capped at
> 4095. Changing it like this makes it match how sysfs_write_file() is
> implemented.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Joel Becker <jlbec@evilplan.org>
Do you want me to push this up, or will you be sending it?
Joel
> ---
> This is a static analysis patch. I haven't found any store_attribute()
> functions where this change makes a difference.
>
> diff --git a/fs/configfs/file.c b/fs/configfs/file.c
> index 2b6cb23..1d1c41f 100644
> --- a/fs/configfs/file.c
> +++ b/fs/configfs/file.c
> @@ -203,7 +203,7 @@ configfs_write_file(struct file *file, const char __user *buf, size_t count, lof
> mutex_lock(&buffer->mutex);
> len = fill_write_buffer(buffer, buf, count);
> if (len > 0)
> - len = flush_write_buffer(file->f_path.dentry, buffer, count);
> + len = flush_write_buffer(file->f_path.dentry, buffer, len);
> if (len > 0)
> *ppos += len;
> mutex_unlock(&buffer->mutex);
--
"In the room the women come and go
Talking of Michaelangelo."
http://www.jlbec.org/
jlbec@evilplan.org
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] configfs: use capped length for ->store_attribute()
@ 2013-05-02 21:51 ` Joel Becker
0 siblings, 0 replies; 6+ messages in thread
From: Joel Becker @ 2013-05-02 21:51 UTC (permalink / raw)
To: Dan Carpenter; +Cc: linux-kernel, kernel-janitors
On Tue, Apr 30, 2013 at 10:28:14AM +0300, Dan Carpenter wrote:
> The difference between "count" and "len" is that "len" is capped at
> 4095. Changing it like this makes it match how sysfs_write_file() is
> implemented.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Joel Becker <jlbec@evilplan.org>
Do you want me to push this up, or will you be sending it?
Joel
> ---
> This is a static analysis patch. I haven't found any store_attribute()
> functions where this change makes a difference.
>
> diff --git a/fs/configfs/file.c b/fs/configfs/file.c
> index 2b6cb23..1d1c41f 100644
> --- a/fs/configfs/file.c
> +++ b/fs/configfs/file.c
> @@ -203,7 +203,7 @@ configfs_write_file(struct file *file, const char __user *buf, size_t count, lof
> mutex_lock(&buffer->mutex);
> len = fill_write_buffer(buffer, buf, count);
> if (len > 0)
> - len = flush_write_buffer(file->f_path.dentry, buffer, count);
> + len = flush_write_buffer(file->f_path.dentry, buffer, len);
> if (len > 0)
> *ppos += len;
> mutex_unlock(&buffer->mutex);
--
"In the room the women come and go
Talking of Michaelangelo."
http://www.jlbec.org/
jlbec@evilplan.org
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] configfs: use capped length for ->store_attribute()
2013-05-02 21:51 ` Joel Becker
@ 2013-05-02 22:00 ` Dan Carpenter
-1 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2013-05-02 22:00 UTC (permalink / raw)
To: linux-kernel, kernel-janitors
On Thu, May 02, 2013 at 02:51:53PM -0700, Joel Becker wrote:
> On Tue, Apr 30, 2013 at 10:28:14AM +0300, Dan Carpenter wrote:
> > The difference between "count" and "len" is that "len" is capped at
> > 4095. Changing it like this makes it match how sysfs_write_file() is
> > implemented.
> >
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> Acked-by: Joel Becker <jlbec@evilplan.org>
>
> Do you want me to push this up, or will you be sending it?
Could you push it?
regards,
dan carpenter
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] configfs: use capped length for ->store_attribute()
@ 2013-05-02 22:00 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2013-05-02 22:00 UTC (permalink / raw)
To: linux-kernel, kernel-janitors
On Thu, May 02, 2013 at 02:51:53PM -0700, Joel Becker wrote:
> On Tue, Apr 30, 2013 at 10:28:14AM +0300, Dan Carpenter wrote:
> > The difference between "count" and "len" is that "len" is capped at
> > 4095. Changing it like this makes it match how sysfs_write_file() is
> > implemented.
> >
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> Acked-by: Joel Becker <jlbec@evilplan.org>
>
> Do you want me to push this up, or will you be sending it?
Could you push it?
regards,
dan carpenter
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-05-02 22:00 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-30 7:28 [patch] configfs: use capped length for ->store_attribute() Dan Carpenter
2013-04-30 7:28 ` Dan Carpenter
2013-05-02 21:51 ` Joel Becker
2013-05-02 21:51 ` Joel Becker
2013-05-02 22:00 ` Dan Carpenter
2013-05-02 22:00 ` Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.