Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'configfs-5.14' of git://git.infradead.org/users/hch/configfs

Pull configfs fix from Christoph Hellwig:

- fix to revert to the historic write behavior (Bart Van Assche)

* tag 'configfs-5.14' of git://git.infradead.org/users/hch/configfs:
configfs: restore the kernel v5.13 text attribute write behavior

+6 -12
+6 -12
fs/configfs/file.c
··· 177 177 return retval; 178 178 } 179 179 180 - /* Fill [buffer, buffer + pos) with data coming from @from. */ 181 - static int fill_write_buffer(struct configfs_buffer *buffer, loff_t pos, 180 + /* Fill @buffer with data coming from @from. */ 181 + static int fill_write_buffer(struct configfs_buffer *buffer, 182 182 struct iov_iter *from) 183 183 { 184 - loff_t to_copy; 185 184 int copied; 186 - u8 *to; 187 185 188 186 if (!buffer->page) 189 187 buffer->page = (char *)__get_free_pages(GFP_KERNEL, 0); 190 188 if (!buffer->page) 191 189 return -ENOMEM; 192 190 193 - to_copy = SIMPLE_ATTR_SIZE - 1 - pos; 194 - if (to_copy <= 0) 195 - return 0; 196 - to = buffer->page + pos; 197 - copied = copy_from_iter(to, to_copy, from); 191 + copied = copy_from_iter(buffer->page, SIMPLE_ATTR_SIZE - 1, from); 198 192 buffer->needs_read_fill = 1; 199 193 /* if buf is assumed to contain a string, terminate it by \0, 200 194 * so e.g. sscanf() can scan the string easily */ 201 - to[copied] = 0; 195 + buffer->page[copied] = 0; 202 196 return copied ? : -EFAULT; 203 197 } 204 198 ··· 221 227 { 222 228 struct file *file = iocb->ki_filp; 223 229 struct configfs_buffer *buffer = file->private_data; 224 - ssize_t len; 230 + int len; 225 231 226 232 mutex_lock(&buffer->mutex); 227 - len = fill_write_buffer(buffer, iocb->ki_pos, from); 233 + len = fill_write_buffer(buffer, from); 228 234 if (len > 0) 229 235 len = flush_write_buffer(file, buffer, len); 230 236 if (len > 0)