IB/hfi1: Use kernel default llseek for ui device
Subsystems (2)
PATCH 1/1 IB/hfi1: Use kernel default llseek for ui device
From: Dean Luick <[email protected]>
The ui device llseek had a mistake with SEEK_END and did not fully follow seek semantics. Correct all this by using a kernel supplied function for fixed size devices.
--- drivers/staging/rdma/hfi1/file_ops.c | 25 ++----------------------- 1 files changed, 2 insertions(+), 23 deletions(-)
drivers/staging/rdma/hfi1/file_ops.c +2 -23
@@ -1559,29 +1559,8 @@ static loff_t ui_lseek(struct file *filp, loff_t offset, int whence) {struct hfi1_devdata *dd = filp->private_data; -switch (whence) { -case SEEK_SET : -break ; -case SEEK_CUR : - offset += filp->f_pos; -break ; -case SEEK_END : - offset = ((dd->kregend - dd->kregbase) +DC8051_DATA_MEM_SIZE ) - - offset; -break ; -default : -return -EINVAL ; - } - -if (offset <0 ) -return -EINVAL ; - -if (offset >= (dd->kregend - dd->kregbase) +DC8051_DATA_MEM_SIZE ) -return -EINVAL ; - - filp->f_pos = offset; - -return filp->f_pos; +return fixed_size_llseek (filp, offset, whence, + (dd->kregend - dd->kregbase) +DC8051_DATA_MEM_SIZE ); }/* NOTE: assumes unsigned long is 8 bytes */
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20160422181702.15797.42892.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org
Quoted 5 lines · Dennis Dalessandro
From: Dean Luick <[email protected]>
The ui device llseek had a mistake with
SEEK_ENDand did not fully follow seek semantics. Correct all this by using a kernel supplied function for fixed size devices.
Doug, I think this should probably go in the rc, it fixes a 0-day bug.
-Denny
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20160422182125.GA21996-W4f6Xiosr+yv7QzWx2u06xL4W9x8LtSr@public.gmane.org
Quoted 10 lines · Dennis Dalessandro
Quoted 5 lines · Dennis Dalessandro
From: Dean Luick <[email protected]>
The ui device llseek had a mistake with
SEEK_ENDand did not fully follow seek semantics. Correct all this by using a kernel supplied function for fixed size devices.Doug, I think this should probably go in the rc, it fixes a 0-day bug.
-Denny
It's in my next pull request.
Signature · 2 lines
Doug Ledford <[email protected]> GPG KeyID: 0E572FDD