Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dm thin: display 'needs_check' in status if it is set

There is currently no way to see that the needs_check flag has been set
in the metadata. Display 'needs_check' in the thin-pool status if it is
set in the thinp metadata.

Also, update thinp documentation.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>

+16 -3
+8 -1
Documentation/device-mapper/thin-provisioning.txt
··· 296 296 underlying device. When this is enabled when loading the table, 297 297 it can get disabled if the underlying device doesn't support it. 298 298 299 - ro|rw 299 + ro|rw|out_of_data_space 300 300 If the pool encounters certain types of device failures it will 301 301 drop into a read-only metadata mode in which no changes to 302 302 the pool metadata (like allocating new blocks) are permitted. ··· 313 313 'no_space_timeout' expires. The 'no_space_timeout' dm-thin-pool 314 314 module parameter can be used to change this timeout -- it 315 315 defaults to 60 seconds but may be disabled using a value of 0. 316 + 317 + needs_check 318 + A metadata operation has failed, resulting in the needs_check 319 + flag being set in the metadata's superblock. The metadata 320 + device must be deactivated and checked/repaired before the 321 + thin-pool can be made fully operational again. '-' indicates 322 + needs_check is not set. 316 323 317 324 iii) Messages 318 325
+8 -2
drivers/md/dm-thin.c
··· 3738 3738 * Status line is: 3739 3739 * <transaction id> <used metadata sectors>/<total metadata sectors> 3740 3740 * <used data sectors>/<total data sectors> <held metadata root> 3741 + * <pool mode> <discard config> <no space config> <needs_check> 3741 3742 */ 3742 3743 static void pool_status(struct dm_target *ti, status_type_t type, 3743 3744 unsigned status_flags, char *result, unsigned maxlen) ··· 3839 3838 DMEMIT("error_if_no_space "); 3840 3839 else 3841 3840 DMEMIT("queue_if_no_space "); 3841 + 3842 + if (dm_pool_metadata_needs_check(pool->pmd)) 3843 + DMEMIT("needs_check "); 3844 + else 3845 + DMEMIT("- "); 3842 3846 3843 3847 break; 3844 3848 ··· 3948 3942 .name = "thin-pool", 3949 3943 .features = DM_TARGET_SINGLETON | DM_TARGET_ALWAYS_WRITEABLE | 3950 3944 DM_TARGET_IMMUTABLE, 3951 - .version = {1, 15, 0}, 3945 + .version = {1, 16, 0}, 3952 3946 .module = THIS_MODULE, 3953 3947 .ctr = pool_ctr, 3954 3948 .dtr = pool_dtr, ··· 4335 4329 4336 4330 static struct target_type thin_target = { 4337 4331 .name = "thin", 4338 - .version = {1, 15, 0}, 4332 + .version = {1, 16, 0}, 4339 4333 .module = THIS_MODULE, 4340 4334 .ctr = thin_ctr, 4341 4335 .dtr = thin_dtr,