• Nikos Tsironis's avatar
    dm thin: fix bug where bio that overwrites thin block ignores FUA · e161e0ef
    Nikos Tsironis authored
    commit 4ae280b4 upstream.
    
    When provisioning a new data block for a virtual block, either because
    the block was previously unallocated or because we are breaking sharing,
    if the whole block of data is being overwritten the bio that triggered
    the provisioning is issued immediately, skipping copying or zeroing of
    the data block.
    
    When this bio completes the new mapping is inserted in to the pool's
    metadata by process_prepared_mapping(), where the bio completion is
    signaled to the upper layers.
    
    This completion is signaled without first committing the metadata.  If
    the bio in question has the REQ_FUA flag set and the system crashes
    right after its completion and before the next metadata commit, then the
    write is lost despite the REQ_FUA flag requiring that I/O completion for
    this request must only be signaled after the data has been committed to
    non-volatile storage.
    
    Fix this by deferring the completion of overwrite bios, with the REQ_FUA
    flag set, until after the metadata has been committed.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: 's avatarNikos Tsironis <ntsironis@arrikto.com>
    Acked-by: 's avatarJoe Thornber <ejt@redhat.com>
    Acked-by: 's avatarMikulas Patocka <mpatocka@redhat.com>
    Signed-off-by: 's avatarMike Snitzer <snitzer@redhat.com>
    Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    e161e0ef
Name
Last commit
Last update
..
bcache Loading commit data...
persistent-data Loading commit data...
Kconfig Loading commit data...
Makefile Loading commit data...
dm-bio-prison-v1.c Loading commit data...
dm-bio-prison-v1.h Loading commit data...
dm-bio-prison-v2.c Loading commit data...
dm-bio-prison-v2.h Loading commit data...
dm-bio-record.h Loading commit data...
dm-bufio.c Loading commit data...
dm-builtin.c Loading commit data...
dm-cache-background-tracker.c Loading commit data...
dm-cache-background-tracker.h Loading commit data...
dm-cache-block-types.h Loading commit data...
dm-cache-metadata.c Loading commit data...
dm-cache-metadata.h Loading commit data...
dm-cache-policy-internal.h Loading commit data...
dm-cache-policy-smq.c Loading commit data...
dm-cache-policy.c Loading commit data...
dm-cache-policy.h Loading commit data...
dm-cache-target.c Loading commit data...
dm-core.h Loading commit data...
dm-crypt.c Loading commit data...
dm-delay.c Loading commit data...
dm-era-target.c Loading commit data...
dm-exception-store.c Loading commit data...
dm-exception-store.h Loading commit data...
dm-flakey.c Loading commit data...
dm-integrity.c Loading commit data...
dm-io.c Loading commit data...
dm-ioctl.c Loading commit data...
dm-kcopyd.c Loading commit data...
dm-linear.c Loading commit data...
dm-log-userspace-base.c Loading commit data...
dm-log-userspace-transfer.c Loading commit data...
dm-log-userspace-transfer.h Loading commit data...
dm-log-writes.c Loading commit data...
dm-log.c Loading commit data...
dm-mpath.c Loading commit data...
dm-mpath.h Loading commit data...
dm-path-selector.c Loading commit data...
dm-path-selector.h Loading commit data...
dm-queue-length.c Loading commit data...
dm-raid.c Loading commit data...
dm-raid1.c Loading commit data...
dm-region-hash.c Loading commit data...
dm-round-robin.c Loading commit data...
dm-rq.c Loading commit data...
dm-rq.h Loading commit data...
dm-service-time.c Loading commit data...
dm-snap-persistent.c Loading commit data...
dm-snap-transient.c Loading commit data...
dm-snap.c Loading commit data...
dm-stats.c Loading commit data...
dm-stats.h Loading commit data...
dm-stripe.c Loading commit data...
dm-switch.c Loading commit data...
dm-sysfs.c Loading commit data...
dm-table.c Loading commit data...
dm-target.c Loading commit data...
dm-thin-metadata.c Loading commit data...
dm-thin-metadata.h Loading commit data...
dm-thin.c Loading commit data...
dm-uevent.c Loading commit data...
dm-uevent.h Loading commit data...
dm-unstripe.c Loading commit data...
dm-verity-fec.c Loading commit data...
dm-verity-fec.h Loading commit data...
dm-verity-target.c Loading commit data...
dm-verity.h Loading commit data...
dm-writecache.c Loading commit data...
dm-zero.c Loading commit data...
dm-zoned-metadata.c Loading commit data...
dm-zoned-reclaim.c Loading commit data...
dm-zoned-target.c Loading commit data...
dm-zoned.h Loading commit data...
dm.c Loading commit data...
dm.h Loading commit data...
md-bitmap.c Loading commit data...
md-bitmap.h Loading commit data...
md-cluster.c Loading commit data...
md-cluster.h Loading commit data...
md-faulty.c Loading commit data...
md-linear.c Loading commit data...
md-linear.h Loading commit data...
md-multipath.c Loading commit data...
md-multipath.h Loading commit data...
md.c Loading commit data...
md.h Loading commit data...
raid0.c Loading commit data...
raid0.h Loading commit data...
raid1-10.c Loading commit data...
raid1.c Loading commit data...
raid1.h Loading commit data...
raid10.c Loading commit data...
raid10.h Loading commit data...
raid5-cache.c Loading commit data...
raid5-log.h Loading commit data...
raid5-ppl.c Loading commit data...
raid5.c Loading commit data...
raid5.h Loading commit data...