android_kernel_samsung_msm8976/drivers/md
Joe Thornber f4cf4b1b2d dm thin: switch to read only mode if a mapping insert fails
commit fafc7a815e40255d24e80a1cb7365892362fa398 upstream.

Switch the thin pool to read-only mode when dm_thin_insert_block() fails
since there is little reason to expect the cause of the failure to be
resolved without further action by user space.

This issue was noticed with the device-mapper-test-suite using:
dmtest run --suite thin-provisioning -n /exhausting_metadata_space_causes_fail_mode/

The quantity of errors logged in this case must be reduced.

before patch:

device-mapper: thin: dm_thin_insert_block() failed
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: thin: dm_thin_insert_block() failed
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: thin: dm_thin_insert_block() failed
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: thin: dm_thin_insert_block() failed
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: thin: dm_thin_insert_block() failed
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: thin: dm_thin_insert_block() failed
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: thin: dm_thin_insert_block() failed
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: thin: dm_thin_insert_block() failed
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: thin: dm_thin_insert_block() failed
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: thin: dm_thin_insert_block() failed
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: space map metadata: unable to allocate new metadata block
<snip ... these repeat for a long while ... >
device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: space map common: dm_tm_shadow_block() failed
device-mapper: thin: 253:4: no free metadata space available.
device-mapper: thin: 253:4: switching pool to read-only mode

after patch:

device-mapper: space map metadata: unable to allocate new metadata block
device-mapper: thin: 253:4: dm_thin_insert_block() failed: error = -28
device-mapper: thin: 253:4: switching pool to read-only mode

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 07:45:11 -08:00
..
bcache bcache: Fixed incorrect order of arguments to bio_alloc_bioset() 2013-11-13 12:05:30 +09:00
persistent-data dm space map metadata: return on failure in sm_metadata_new_block 2013-12-20 07:45:11 -08:00
bitmap.c md: use set_bit_le and clear_bit_le 2013-04-24 11:42:41 +10:00
bitmap.h
dm-bio-prison.c dm: add cache target 2013-03-01 22:45:51 +00:00
dm-bio-prison.h dm: add cache target 2013-03-01 22:45:51 +00:00
dm-bio-record.h
dm-bufio.c dm bufio: initialize read-only module parameters 2013-12-20 07:45:10 -08:00
dm-bufio.h
dm-cache-block-types.h dm: add cache target 2013-03-01 22:45:51 +00:00
dm-cache-metadata.c dm cache: replace memcpy with struct assignment 2013-05-10 14:37:18 +01:00
dm-cache-metadata.h dm cache: policy ignore hints if generated by different version 2013-03-20 17:21:28 +00:00
dm-cache-policy-cleaner.c dm cache: policy change version from string to integer set 2013-03-20 17:21:27 +00:00
dm-cache-policy-internal.h dm cache: policy change version from string to integer set 2013-03-20 17:21:27 +00:00
dm-cache-policy-mq.c dm cache: policy change version from string to integer set 2013-03-20 17:21:27 +00:00
dm-cache-policy.c dm cache: policy change version from string to integer set 2013-03-20 17:21:27 +00:00
dm-cache-policy.h dm cache policy: fix description of lookup fn 2013-05-10 14:37:17 +01:00
dm-cache-target.c dm cache: fix a race condition between queuing new migrations and quiescing for a shutdown 2013-12-04 10:56:43 -08:00
dm-crypt.c block: Convert some code to bio_for_each_segment_all() 2013-03-23 14:26:30 -07:00
dm-delay.c dm delay: fix a possible deadlock due to shared workqueue 2013-12-20 07:45:11 -08:00
dm-exception-store.c dm: replace simple_strtoul 2012-07-27 15:07:59 +01:00
dm-exception-store.h
dm-flakey.c dm: rename request variables to bios 2013-03-01 22:45:47 +00:00
dm-io.c dm kcopyd: add WRITE SAME support to dm_kcopyd_zero 2012-12-21 20:23:37 +00:00
dm-ioctl.c dm ioctl: set noio flag to avoid __vmalloc deadlock 2013-08-04 16:51:02 +08:00
dm-kcopyd.c dm kcopyd: introduce configurable throttling 2013-03-01 22:45:49 +00:00
dm-linear.c dm: rename request variables to bios 2013-03-01 22:45:47 +00:00
dm-log-userspace-base.c
dm-log-userspace-transfer.c
dm-log-userspace-transfer.h
dm-log.c dm: use memweight() 2012-07-30 17:25:16 -07:00
dm-mpath.c dm mpath: fix race condition between multipath_dtr and pg_init_done 2013-12-04 10:56:41 -08:00
dm-mpath.h
dm-path-selector.c
dm-path-selector.h
dm-queue-length.c
dm-raid.c dm-raid: silence compiler warning on rebuilds_per_group. 2013-10-05 07:13:11 -07:00
dm-raid1.c block: Use bio_sectors() more consistently 2013-03-23 14:15:30 -07:00
dm-region-hash.c dm raid1: fix crash with mirror recovery and discard 2012-07-20 14:25:03 +01:00
dm-round-robin.c
dm-service-time.c
dm-snap-persistent.c dm snapshot: fix data corruption 2013-11-04 04:31:06 -08:00
dm-snap-transient.c
dm-snap.c dm snapshot: avoid snapshot space leak on crash 2013-12-20 07:45:10 -08:00
dm-stripe.c dm stripe: fix regression in stripe_width calculation 2013-05-10 14:37:14 +01:00
dm-sysfs.c
dm-table.c dm table: fail dm_table_create on dm_round_up overflow 2013-12-20 07:45:11 -08:00
dm-target.c dm: rename request variables to bios 2013-03-01 22:45:47 +00:00
dm-thin-metadata.c dm thin: generate event when metadata threshold passed 2013-05-10 14:37:21 +01:00
dm-thin-metadata.h dm thin: generate event when metadata threshold passed 2013-05-10 14:37:21 +01:00
dm-thin.c dm thin: switch to read only mode if a mapping insert fails 2013-12-20 07:45:11 -08:00
dm-uevent.c
dm-uevent.h
dm-verity.c dm verity: fix inability to use a few specific devices sizes 2013-08-04 16:51:02 +08:00
dm-zero.c dm: rename request variables to bios 2013-03-01 22:45:47 +00:00
dm.c dm mpath: disable WRITE SAME if it fails 2013-10-05 07:13:11 -07:00
dm.h dm: introduce per_bio_data 2012-12-21 20:23:38 +00:00
faulty.c block: Add bio_end_sector() 2013-03-23 14:15:29 -07:00
Kconfig bcache: A block layer cache 2013-03-23 16:11:31 -07:00
linear.c block: Add bio_end_sector() 2013-03-23 14:15:29 -07:00
linear.h
Makefile bcache: A block layer cache 2013-03-23 16:11:31 -07:00
md.c md: fix calculation of stacking limits on level change. 2013-12-04 10:57:15 -08:00
md.h MD: Export 'md_reap_sync_thread' function 2013-04-24 11:42:43 +10:00
multipath.c MD: change the parameter of md thread 2012-10-11 13:34:00 +11:00
multipath.h
raid0.c block: Change bio_split() to respect the current value of bi_idx 2013-03-23 14:15:30 -07:00
raid0.h
raid1.c md: Fix skipping recovery for read-only arrays. 2013-11-13 12:05:32 +09:00
raid1.h md/raid1: prevent merging too large request 2012-07-31 10:03:53 +10:00
raid5.c raid5: avoid finding "discard" stripe 2013-11-13 12:05:31 +09:00
raid5.h md/raid5: fix interaction of 'replace' and 'recovery'. 2013-08-04 16:50:54 +08:00
raid10.c md: Fix skipping recovery for read-only arrays. 2013-11-13 12:05:32 +09:00
raid10.h MD RAID10: Improve redundancy for 'far' and 'offset' algorithms (part 1) 2013-02-26 11:55:30 +11:00