• Rolf Fokkens's avatar
    [PATCH] sg.c and USER_HZ, kernel 2.5.37 · 8885e375
    Rolf Fokkens authored
    Hi!
    
    Since the introduction of USER_HZ the SG_[GS]ET_TIMEOUT ioctls may have
    a serious BUG as userspace uses a different HZ from the HZ in kernelspace.
    
    In x86 HZ=1000 and USER_HZ=100, resulting in confusing timouts as the
    kernel measures time 10 times as fast as userspace.
    
    This patch is an attempt to fix this by transforming USER_HZ based timing to
    HZ based timing before storing it in timeout. To make sure that SG_GET_TIMEOUT
    and SG_SET_TIMEOUT behave consistently a field timeout_user is added which
    stores the exact value that's passed by SG_SET_TIMEOUT and it's returned on
    SG_GET_TIMEOUT.
    
    Rolf Fokkens
    fokkensr@fokkensr.vertis.nl
    
    P.S. this is the second post of this patch
    8885e375
sg.h 14.4 KB