Jouni Roivas
65026da59c
cgroup: Zero sized write should be no-op
...
Do not report failure on zero sized writes, and handle them as no-op.
There's issues for example in case of writev() when there's iovec
containing zero buffer as a first one. It's expected writev() on below
example to successfully perform the write to specified writable cgroup
file expecting integer value, and to return 2. For now it's returning
value -1, and skipping the write:
int writetest(int fd) {
const char *buf1 = "";
const char *buf2 = "1\n";
struct iovec iov[2] = {
{ .iov_base = (void*)buf1, .iov_len = 0 },
{ .iov_base = (void*)buf2, .iov_len = 2 }
};
return writev(fd, iov, 2);
}
This patch fixes the issue by checking if there's nothing to write,
and handling the write as no-op by just returning 0.
Signed-off-by: Jouni Roivas <jouni.roivas@tuxera.com >
Signed-off-by: Tejun Heo <tj@kernel.org >
2020-09-30 13:52:06 -04:00
..
2020-09-15 19:26:21 -07:00
2020-09-30 13:52:06 -04:00
2020-04-07 10:43:42 -07:00
2020-08-23 17:36:59 -05:00
2020-08-27 09:22:56 +02:00
2020-09-14 22:49:51 +02:00
2020-08-23 17:36:59 -05:00
2020-09-11 09:33:54 -07:00
2020-08-30 12:01:23 -07:00
2020-08-01 09:26:27 +02:00
2020-05-11 00:31:38 +02:00
2020-09-16 16:26:56 +02:00
2020-08-23 17:36:59 -05:00
2020-08-04 22:22:25 -07:00
2020-09-25 10:39:22 -07:00
2020-08-30 11:43:50 -07:00
2020-08-23 17:36:59 -05:00
2020-09-22 09:08:33 -07:00
2020-03-25 11:50:48 +01:00
2020-06-09 09:39:14 -07:00
2020-07-16 12:35:15 -07:00
2020-07-27 23:25:50 +02:00
2020-08-06 19:29:51 -07:00
2020-07-27 23:25:50 +02:00
2020-08-04 14:20:26 -07:00
2020-07-29 10:00:36 -04:00
2020-08-23 17:36:59 -05:00
2020-08-04 14:20:26 -07:00
2020-07-30 11:15:58 -07:00
2020-08-23 17:36:59 -05:00
2020-08-23 17:36:59 -05:00
2020-06-11 15:14:36 +02:00
2020-05-15 11:44:34 -07:00
2020-06-03 13:06:42 -07:00
2020-08-12 10:58:01 -07:00
2020-04-15 11:21:54 +02:00
2020-05-20 14:44:21 -05:00
2020-08-12 10:57:59 -07:00
2020-04-07 10:43:42 -07:00
2020-09-27 11:21:35 -07:00
2020-08-13 21:02:12 +02:00
2020-06-06 23:42:01 +09:00
2020-06-02 10:59:11 -07:00
2020-06-08 11:05:56 -07:00
2020-05-28 10:54:15 +02:00
2020-08-23 17:36:59 -05:00
2020-03-25 10:04:01 -05:00
2020-08-12 10:58:02 -07:00
2020-08-15 10:38:03 -07:00
2020-08-12 10:58:01 -07:00
2020-09-22 09:08:33 -07:00
2020-08-12 10:57:59 -07:00
2020-04-27 02:07:40 -04:00
2020-08-14 19:56:56 -07:00
2020-08-14 11:07:02 -07:00
2020-06-02 10:59:12 -07:00
2020-07-08 11:14:22 +02:00
2020-09-04 17:51:55 +10:00
2020-08-12 10:58:02 -07:00
2020-07-19 20:14:42 +02:00
2020-08-04 15:02:07 -07:00
2020-07-01 12:09:13 +03:00
2020-07-27 14:31:12 -04:00
2020-08-21 09:52:53 -07:00
2020-05-27 11:10:05 +02:00
2020-08-07 11:33:25 -07:00
2020-09-08 11:30:16 -07:00
2020-08-23 17:36:59 -05:00
2020-07-22 10:22:04 +02:00
2020-08-04 13:40:35 -07:00
2020-09-19 13:13:39 -07:00
2020-08-12 10:57:59 -07:00
2020-08-14 19:56:56 -07:00
2020-08-23 17:36:59 -05:00
2020-09-17 10:26:41 -07:00
2020-08-13 09:01:38 -06:00
2020-06-29 12:01:45 -07:00
2020-04-07 21:51:27 +02:00
2020-08-12 10:57:59 -07:00
2020-05-09 13:57:12 +02:00
2020-06-04 19:06:24 -07:00
2020-07-07 11:58:59 -05:00
2020-04-27 02:07:40 -04:00
2020-05-09 13:57:12 +02:00
2020-08-17 09:39:18 -07:00
2020-06-08 11:05:56 -07:00
2020-06-17 10:57:41 -07:00