freebsd-src icon indicating copy to clipboard operation
freebsd-src copied to clipboard

ps3disk.c: Rewrite ps3disk_transfer

Open aomsin2526 opened this issue 1 year ago • 6 comments

This function is bugged since the beginning, but it never hit because its variable doesn't allow.

However, since commit a77e1f0f81df5fa3b4a6a38728ebace599cb18a4 it happen now.

First, it assume that ds_len will always equal to real user requested size. So it being used for sector count calculation.

This is no longer true, and will fail if attempt to read last few sectors.

Use bp->bio_length instead.

Second, this being a loop is pointless because nsegs will never be > 1 as specified at bus_dma_tag_create() call.

And all it doing is to repeat very same command again but with different ds_addr. Since bio_driver2 tag ident pointer are being reused, the result will be discarded at ps3disk_intr().

aomsin2526 avatar Sep 11 '24 12:09 aomsin2526

While I'm not sure about the contents of the patch, permissions seem to change from 644 to 755. C source files should definitely be 644.

pkubaj avatar Sep 11 '24 14:09 pkubaj

Fixed, thanks.

aomsin2526 avatar Sep 11 '24 14:09 aomsin2526

This may be ready, but I think @amotin 's comments need a response at the very least.

bsdimp avatar Oct 04 '24 18:10 bsdimp

I think at the least, we should remove the assert since we have code to handle when it fails and we usually do one or the other.

bsdimp avatar Oct 04 '24 18:10 bsdimp

There is a CI failure: do not set execute permissions for source files

While in the end, there are no execute permissions for source files, one of your commits introduces those and then another one removes it. Can you squash those commits so that there are no execute permissions set at all? Then the CI failure should go away.

pkubaj avatar Oct 16 '24 13:10 pkubaj

Should be good now

aomsin2526 avatar Oct 16 '24 14:10 aomsin2526

my automation messed up, so I couldn't push this to close it as merged.

bsdimp avatar Jan 24 '25 19:01 bsdimp