Re: [GIT PULL] iscsi-target merge for v3.1-rc1

Andy Grover
2011-07-26T01:09:41Z

On 07/25/2011 05:32 PM, Nicholas A. Bellinger wrote:
> On Mon, 2011-07-25 at 16:37 -0700, Andrew Morton wrote:
>> On Sat, 23 Jul 2011 16:16:15 -0700
>> "Nicholas A. Bellinger" <nab@linux-iscsi.org> wrote:
>>
>>> Please go ahead and pull from:
>>>
>>> master.kernel.org:/pub/scm/linux/kernel/git/nab/target-pending.git for-linus-merge
>>
>> i386 allyesconfig:
>>
>> ERROR: "__udivdi3" [drivers/target/target_core_mod.ko] undefined!
>>
>> somewhere in drivers/target/target_core_transport.c:transport_allocate_data_tasks().
>
> Mmmm, I was under the assumption that DIV_ROUND_UP() did unsigned long
> long division correctly for sector_t on 32-bit , but apparently not with
> the new v4.1 transport_allocate_data_tasks() code.. Andy..?

sectors = DIV_ROUND_UP(cmd->data_length, sector_size);
task_count = DIV_ROUND_UP(sectors, dev_max_sectors);

sectors is a sector_t but the value will never be >32bits, since
data_length is u32.

We could just cast sectors to a u32 and be ok for this particular
usage... DIV_ROUND_UP handling 64bit would of course also resolve the
issue nicely.

Regards -- Andy