aio: intialize kiocb private
Subsystems (3)
cover aio: intialize kiocb private
From: Mike Marshall <[email protected]>
"aio: don't zero entire aio_kiocb aio_get_req" triggered these BUG_ONs in orangefs file.c. Obviously the BUG_ONs need to go.
There might be other filesystems that use iocb->private without failing in a way that is as obvious as BUG_ON, though I didn't see any with grep.
After discussion on fsdevel, Jens Axboe suggested I should send in a patch that continues to set iocb->private to NULL just in case.
Also... phooey on fighting gmail when trying to send patches with git-send-email... mail.kernel.org works great!
-Mike
PATCH 1/2 orangefs: remove two un-needed BUG_ONs...
From: Mike Marshall <[email protected]>
--- fs/orangefs/file.c | 4 ---- 1 file changed, 4 deletions(-)
fs/orangefs/file.c +0 -4
@@ -398,8 +398,6 @@ static ssize_t orangefs_file_read_iter(struct kiocb *iocb, struct iov_iter *iterloff_t pos = iocb->ki_pos;ssize_t rc =0 ; -BUG_ON (iocb->private); -gossip_debug (GOSSIP_FILE_DEBUG ,"orangefs_file_read_iter\n" ); orangefs_stats.reads++;
@@ -416,8 +414,6 @@ static ssize_t orangefs_file_write_iter(struct kiocb *iocb, struct iov_iter *iteloff_t pos;ssize_t rc; -BUG_ON (iocb->private); -gossip_debug (GOSSIP_FILE_DEBUG ,"orangefs_file_write_iter\n" );inode_lock (file->f_mapping->host);
Signature · 1 line
2.20.1
Re: [PATCH 1/2] orangefs: remove two un-needed BUG_ONs...
Didn't these catch the issue you fix in patch 2?
Mike Marshall
maintainerRe: [PATCH 1/2] orangefs: remove two un-needed BUG_ONs...
Yes, but I don't think they should be there. You put them into pvfs2_file_aio_read_iovec way back when (Martin guesses you were making sure that you had fully eradicated private's use) and I left them in when I changed that function over to pvfs2_file_read_iter. After that, they've just gone along for the ride... BUG_ONs that the maintainer can't justify might be the kind of thing that would make Linus violate the new code of conduct :-) ...
-Mike
Quoted 2 lines · Christoph Hellwig
Didn't these catch the issue you fix in patch 2?
PATCH 2/2 aio: initialize kiocb private in case any filesystems expect it.
In reply to [email protected]From: Mike Marshall <[email protected]>
A recent optimization had left private uninitialized.
--- fs/aio.c | 1 + 1 file changed, 1 insertion(+)
fs/aio.c +1 -0
@@ -1436,6 +1436,7 @@ static int aio_prep_rw(struct kiocb *req, const struct iocb *iocb)if (unlikely (!req->ki_filp))return -EBADF ; req->ki_complete = aio_complete_rw; + req->private =NULL ; req->ki_pos = iocb->aio_offset; req->ki_flags =iocb_flags (req->ki_filp);if (iocb->aio_flags &IOCB_FLAG_RESFD )
Signature · 1 line
2.20.1
Re: [PATCH 2/2] aio: initialize kiocb private in case any filesystems expect it.
Quoted 5 lines · On Tue, Feb 05, 2019 at 02:13:35PM -0500, [email protected] wrote:
From: Mike Marshall <[email protected]>
A recent optimization had left private uninitialized.
Signed-off-by Mike Marshall <[email protected]>
Looks good,
Quoted 9 lines · On 2/5/19 12:13 PM, [email protected] wrote:
From: Mike Marshall <[email protected]>
"aio: don't zero entire
aio_kiocbaio_get_req" triggered theseBUG_ONsin orangefsfile.c. Obviously theBUG_ONsneed to go.There might be other filesystems that use
iocb->privatewithout failing in a way that is as obvious asBUG_ON, though I didn't see any with grep.
Quoted 5 lines
After discussion on fsdevel, Jens Axboe suggested I should send in a patch that continues to set
iocb->privateto NULL just in case.Also... phooey on fighting gmail when trying to send patches with git-send-email... mail.kernel.org works great!
Applied 1/2, 2/2 should probably just go in separately with other orangefs patches, when appropriate.
Signature · 1 line
Jens Axboe