• Lukas Czerner's avatar
    GFS2: Fix FITRIM argument handling · 076f0faa
    Lukas Czerner authored
    Currently implementation in gfs2 uses FITRIM arguments as it were in
    file system blocks units which is wrong. The FITRIM arguments
    (fstrim_range.start, fstrim_range.len and fstrim_range.minlen) are
    actually in bytes.
    
    Moreover, check for start argument beyond the end of file system, len
    argument being smaller than file system block and minlen argument being
    bigger than biggest resource group were missing.
    
    This commit converts the code to convert FITRIM argument to file system
    blocks and also adds appropriate checks mentioned above.
    
    All the problems were recognised by xfstests 251 and 260.
    Signed-off-by: default avatarLukas Czerner <lczerner@redhat.com>
    Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
    076f0faa
rgrp.c 59.2 KB