All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "kernfs: fix regression in kernfs_fop_write caused by wrong type" has been added to the 4.14-stable tree
@ 2018-02-14 14:25 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2018-02-14 14:25 UTC (permalink / raw)
  To: ivecera, gregkh, tj, viro; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    kernfs: fix regression in kernfs_fop_write caused by wrong type

to the 4.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     kernfs-fix-regression-in-kernfs_fop_write-caused-by-wrong-type.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From ba87977a49913129962af8ac35b0e13e0fa4382d Mon Sep 17 00:00:00 2001
From: Ivan Vecera <ivecera@redhat.com>
Date: Fri, 19 Jan 2018 09:18:54 +0100
Subject: kernfs: fix regression in kernfs_fop_write caused by wrong type

From: Ivan Vecera <ivecera@redhat.com>

commit ba87977a49913129962af8ac35b0e13e0fa4382d upstream.

Commit b7ce40cff0b9 ("kernfs: cache atomic_write_len in
kernfs_open_file") changes type of local variable 'len' from ssize_t
to size_t. This change caused that the *ppos value is updated also
when the previous write callback failed.

Mentioned snippet:
...
len = ops->write(...); <- return value can be negative
...
if (len > 0)           <- true here in this case
        *ppos += len;
...

Fixes: b7ce40cff0b9 ("kernfs: cache atomic_write_len in kernfs_open_file")
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/kernfs/file.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/kernfs/file.c
+++ b/fs/kernfs/file.c
@@ -275,7 +275,7 @@ static ssize_t kernfs_fop_write(struct f
 {
 	struct kernfs_open_file *of = kernfs_of(file);
 	const struct kernfs_ops *ops;
-	size_t len;
+	ssize_t len;
 	char *buf;
 
 	if (of->atomic_write_len) {


Patches currently in stable-queue which might be from ivecera@redhat.com are

queue-4.14/kernfs-fix-regression-in-kernfs_fop_write-caused-by-wrong-type.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-02-14 14:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-14 14:25 Patch "kernfs: fix regression in kernfs_fop_write caused by wrong type" has been added to the 4.14-stable tree gregkh

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.