lindebugfs: Fix write
For write operation pseudofs creates an sbuf with the data. Use this data instead of the uio as it's not usable anymore after uiomove. Reviewed by: hselasky MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D34114
This commit is contained in:
@@ -130,8 +130,14 @@ debugfs_fill(PFS_FILL_ARGS)
|
||||
if ((rc = linux_set_current_flags(curthread, M_NOWAIT)))
|
||||
return (rc);
|
||||
vn.v_data = d->dm_data;
|
||||
buf = uio->uio_iov[0].iov_base;
|
||||
len = min(uio->uio_iov[0].iov_len, uio->uio_resid);
|
||||
if (uio->uio_rw == UIO_READ) {
|
||||
buf = uio->uio_iov[0].iov_base;
|
||||
len = min(uio->uio_iov[0].iov_len, uio->uio_resid);
|
||||
} else {
|
||||
sbuf_finish(sb);
|
||||
buf = sbuf_data(sb);
|
||||
len = sbuf_len(sb);
|
||||
}
|
||||
off = 0;
|
||||
lf.private_data = NULL;
|
||||
rc = d->dm_fops->open(&vn, &lf);
|
||||
|
||||
Reference in New Issue
Block a user