• Jan Kara's avatar
    ext4: gracefully handle ext4_break_layouts() failure during truncate · b9c1c267
    Jan Kara authored
    ext4_break_layouts() may fail e.g. due to a signal being delivered.
    Thus we need to handle its failure gracefully and not by taking the
    filesystem down. Currently ext4_break_layouts() failure is rare but it
    may become more common once RDMA uses layout leases for handling
    long-term page pins for DAX mappings.
    
    To handle the failure we need to move ext4_break_layouts() earlier
    during setattr handling before we do hard to undo changes such as
    modifying inode size. To be able to do that we also have to move some
    other checks which are better done without holding i_mmap_sem earlier.
    Reported-and-tested-by: default avatarIra Weiny <ira.weiny@intel.com>
    Reviewed-by: default avatarIra Weiny <ira.weiny@intel.com>
    Signed-off-by: default avatarJan Kara <jack@suse.cz>
    Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
    b9c1c267
inode.c 180 KB