]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: gracefully handle ext4_break_layouts() failure during truncate
authorJan Kara <jack@suse.cz>
Thu, 30 May 2019 15:56:23 +0000 (11:56 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 30 May 2019 15:56:23 +0000 (11:56 -0400)
commit047b249353c53ce65de9242e90f28d701a2b8b9a
treee44011f1c26fc058d77ad968756fde4740c5453b
parent7f3e30282b380958e65348f1509b90f11030d416
ext4: gracefully handle ext4_break_layouts() failure during truncate

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: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/inode.c