bcache patches for Linux v5.1
Subsystems (3)
cover bcache patches for Linux v5.1
Hi Jens,
This is the bcache patch set for Linux v5.1 merge window.
In this series, we have 4 majour contributers for 19 changes,
- Colin Ian King contributes a patch to improve indent format.
- Danial Axtens fixes a bug by not caching DISCARD/TRIM bio onto cache device, to avoid an oops in block layer code.
- Junhui Tang contributes a fix which removes a bogus BUG_ON() panic by stale and dirty keys.
- I fixes a series of input overflow issues in bcache sysfs interface, and export backing device uuid and name for user space tool. There also is a patch to fix caching read ahead metadata issue for XFS.
Please take them in your for-next.
Thanks in advance.
Coly Li
---
Colin Ian King (1):
bcache: fix indentation issue, remove tabs on a hunk of code
Coly Li (16):
bcache: not use hard coded memset size in bch_cache_accounting_clear()
bcache: export backing_dev_name via sysfs
bcache: export backing_dev_uuid via sysfs
bcache: improve sysfs_strtoul_clamp()
bcache: fix input integer overflow of congested threshold
bcache: fix input overflow to sequential_cutoff
bcache: add sysfs_strtoul_bool() for setting bit-field variables
bcache: use sysfs_strtoul_bool() to set bit-field variables
bcache: fix input overflow to writeback_delay
bcache: fix potential div-zero error of writeback_rate_i_term_inverse
bcache: fix potential div-zero error of writeback_rate_p_term_inverse
bcache: fix input overflow to writeback_rate_minimum
bcache: fix input overflow to journal_delay_ms
bcache: fix input overflow to cache set io_error_limit
bcache: fix input overflow to cache set sysfs file io_error_halflife
bcache: use (REQ_META|REQ_PRIO) to indicate bio for metadata
Daniel Axtens (1):
bcache: never writeback a discard operation
Tang Junhui (1):
bcache: treat stale && dirty keys as bad keys
drivers/md/bcache/extents.c | 13 +++---- drivers/md/bcache/request.c | 7 ++-- drivers/md/bcache/stats.c | 2 +- drivers/md/bcache/super.c | 30 ++++++++-------- drivers/md/bcache/sysfs.c | 81 +++++++++++++++++++++++++++++++------------ drivers/md/bcache/sysfs.h | 23 ++++++++++-- drivers/md/bcache/writeback.h | 3 ++ 7 files changed, 109 insertions(+), 50 deletions(-)
Signature · 1 line
2.16.4
PATCH 1/19 bcache: never writeback a discard operation
From: Daniel Axtens <[email protected]>
Some users see panics like the following when performing fstrim on a bcached volume:
[ 529.803060] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008 [ 530.183928] #PF error: [normal kernel read fault] [ 530.412392] PGD 8000001f42163067 P4D 8000001f42163067 PUD 1f42168067 PMD 0 [ 530.750887] Oops: 0000 [#1] SMP PTI [ 530.920869] CPU: 10 PID: 4167 Comm: fstrim Kdump: loaded Not tainted 5.0.0-rc1+ #3 [ 531.290204] Hardware name: HP ProLiant DL360 Gen9/ProLiant DL360 Gen9, BIOS P89 12/27/2015 [ 531.693137] RIP: 0010:blk_queue_split+0x148/0x620 [ 531.922205] Code: 60 38 89 55 a0 45 31 db 45 31 f6 45 31 c9 31 ff 89 4d 98 85 db 0f 84 7f 04 00 00 44 8b 6d 98 4c 89 ee 48 c1 e6 04 49 03 70 78 <8b> 46 08 44 8b 56 0c 48 8b 16 44 29 e0 39 d8 48 89 55 a8 0f 47 c3 [ 532.838634] RSP: 0018:ffffb9b708df39b0 EFLAGS: 00010246 [ 533.093571] RAX: 00000000ffffffff RBX: 0000000000046000 RCX: 0000000000000000 [ 533.441865] RDX: 0000000000000200 RSI: 0000000000000000 RDI: 0000000000000000 [ 533.789922] RBP: ffffb9b708df3a48 R08: ffff940d3b3fdd20 R09: 0000000000000000 [ 534.137512] R10: ffffb9b708df3958 R11: 0000000000000000 R12: 0000000000000000 [ 534.485329] R13: 0000000000000000 R14: 0000000000000000 R15: ffff940d39212020 [ 534.833319] FS: 00007efec26e3840(0000) GS:ffff940d1f480000(0000) knlGS:0000000000000000 [ 535.224098] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 535.504318] CR2: 0000000000000008 CR3: 0000001f4e256004 CR4: 00000000001606e0 [ 535.851759] Call Trace: [ 535.970308] ? mempool_alloc_slab+0x15/0x20 [ 536.174152] ? bch_data_insert+0x42/0xd0 [bcache] [ 536.403399] blk_mq_make_request+0x97/0x4f0 [ 536.607036] generic_make_request+0x1e2/0x410 [ 536.819164] submit_bio+0x73/0x150 [ 536.980168] ? submit_bio+0x73/0x150 [ 537.149731] ? bio_associate_blkg_from_css+0x3b/0x60 [ 537.391595] ? _cond_resched+0x1a/0x50 [ 537.573774] submit_bio_wait+0x59/0x90 [ 537.756105] blkdev_issue_discard+0x80/0xd0 [ 537.959590] ext4_trim_fs+0x4a9/0x9e0 [ 538.137636] ? ext4_trim_fs+0x4a9/0x9e0 [ 538.324087] ext4_ioctl+0xea4/0x1530 [ 538.497712] ? _copy_to_user+0x2a/0x40 [ 538.679632] do_vfs_ioctl+0xa6/0x600 [ 538.853127] ? __do_sys_newfstat+0x44/0x70 [ 539.051951] ksys_ioctl+0x6d/0x80 [ 539.212785] __x64_sys_ioctl+0x1a/0x20 [ 539.394918] do_syscall_64+0x5a/0x110 [ 539.568674] entry_SYSCALL_64_after_hwframe+0x44/0xa9
We have observed it where both:
1) LVM/devmapper is involved (bcache backing device is LVM volume) and
2) writeback cache is involved (bcache cache_mode is writeback)
On one machine, we can reliably reproduce it with:
# echo writeback > /sys/block/bcache0/bcache/cache_mode
(not sure whether above line is required)
# mount /dev/bcache0 /test
# for i in {0..10}; do
file="$(mktemp /test/zero.XXX)"
dd if=/dev/zero of="$file" bs=1M count=256
sync
rm $file
done
# fstrim -v /testObserving this with tracepoints on, we see the following writes:
fstrim-18019 [022] .... 91107.302026: bcache_write: 73f95583-561c-408f-a93a-4cbd2498f5c8 inode 0 DS 4260112 + 196352 hit 0 bypass 1 fstrim-18019 [022] .... 91107.302050: bcache_write: 73f95583-561c-408f-a93a-4cbd2498f5c8 inode 0 DS 4456464 + 262144 hit 0 bypass 1 fstrim-18019 [022] .... 91107.302075: bcache_write: 73f95583-561c-408f-a93a-4cbd2498f5c8 inode 0 DS 4718608 + 81920 hit 0 bypass 1 fstrim-18019 [022] .... 91107.302094: bcache_write: 73f95583-561c-408f-a93a-4cbd2498f5c8 inode 0 DS 5324816 + 180224 hit 0 bypass 1 fstrim-18019 [022] .... 91107.302121: bcache_write: 73f95583-561c-408f-a93a-4cbd2498f5c8 inode 0 DS 5505040 + 262144 hit 0 bypass 1 fstrim-18019 [022] .... 91107.302145: bcache_write: 73f95583-561c-408f-a93a-4cbd2498f5c8 inode 0 DS 5767184 + 81920 hit 0 bypass 1 fstrim-18019 [022] .... 91107.308777: bcache_write: 73f95583-561c-408f-a93a-4cbd2498f5c8 inode 0 DS 6373392 + 180224 hit 1 bypass 0
<crash>
Note the final one has different hit/bypass flags.
This is because in should_writeback(), we were hitting a case where the partial stripe condition was returning true and so should_writeback() was returning true early.
If that hadn't been the case, it would have hit the would_skip test, and as would_skip == s->iop.bypass == true, should_writeback() would have returned false.
Looking at the git history from 'commit 72c270612bd3 ("bcache: Write out full stripes")', it looks like the idea was to optimise for raid5/6:
* If a stripe is already dirty, force writes to that stripe to writeback mode - to help build up full stripes of dirty data
To fix this issue, make sure that should_writeback() on a discard op never returns true.
More details of debugging:
https://www.spinics.net/lists/linux-bcache/msg06996.html
Previous reports:
- https://bugzilla.kernel.org/show_bug.cgi?id=201051
- https://bugzilla.kernel.org/show_bug.cgi?id=196103
- https://www.spinics.net/lists/linux-bcache/msg06885.html
(Coly Li: minor modification to follow maximum 75 chars per line rule)
--- drivers/md/bcache/writeback.h | 3 +++ 1 file changed, 3 insertions(+)
drivers/md/bcache/writeback.h +3 -0
@@ -71,6 +71,9 @@ static inline bool should_writeback(struct cached_dev *dc, struct bio *bio, in_use > bch_cutoff_writeback_sync)return false; +if (bio_op (bio) ==REQ_OP_DISCARD ) +return false; +if (dc->partial_stripes_expensive &&bcache_dev_stripe_dirty (dc, bio->bi_iter.bi_sector,bio_sectors (bio)))
Signature · 1 line
2.16.4
PATCH 2/19 bcache: not use hard coded memset size in bch_cache_accounting_clear()
In reply to Coly LiIn stats.c:bch_cache_accounting_clear(), a hard coded number '7' is used in memset(). It is because in struct cache_stats, there are 7 atomic_t type members. This is not good when new members added into struct stats, the hard coded number will only clear part of memory.
This patch replaces 'sizeof(unsigned long) * 7' by more generic 'sizeof(struct cache_stats))', to avoid potential error if new member added into struct cache_stats.
--- drivers/md/bcache/stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/bcache/stats.c +1 -1
@@ -111,7 +111,7 @@ void bch_cache_accounting_clear(struct cache_accounting *acc) {memset (&acc->total.cache_hits,0 , -sizeof (unsigned long ) *7 ); +sizeof (struct cache_stats )); }void bch_cache_accounting_destroy (struct cache_accounting *acc)
Signature · 1 line
2.16.4
PATCH 3/19 bcache: export backing_dev_name via sysfs
In reply to Coly LiThis patch export dc->backing_dev_name to sysfs file /sys/block/bcache<?>/bcache/backing_dev_name, then people or user space tools may know the backing device name of this bcache device.
Of cause it can be done by parsing sysfs links, but this method can be much simpler to find the link between bcache device and backing device.
--- drivers/md/bcache/sysfs.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/md/bcache/sysfs.c +8 -0
@@ -67,6 +67,7 @@ read_attribute(written);read_attribute (btree_written);read_attribute (metadata_written);read_attribute (active_journal_entries); +read_attribute (backing_dev_name);sysfs_time_stats_attribute (btree_gc, sec, ms);sysfs_time_stats_attribute (btree_split, sec, us);
@@ -243,6 +244,12 @@ SHOW(__bch_cached_dev)return strlen (buf); } +if (attr == &sysfs_backing_dev_name) { +snprintf (buf,BDEVNAME_SIZE +1 ,"%s" , dc->backing_dev_name); +strcat (buf,"\n" ); +return strlen (buf); + } +#undef varreturn 0 ; }
@@ -452,6 +459,7 @@ static struct attribute *bch_cached_dev_files[] = { &sysfs_verify, &sysfs_bypass_torture_test, #endif + &sysfs_backing_dev_name,NULL };KTYPE (bch_cached_dev);
Signature · 1 line
2.16.4
PATCH 4/19 bcache: export backing_dev_uuid via sysfs
In reply to Coly LiWhen there are multiple bcache devices, after a reboot the name of bcache devices may change (e.g. current /dev/bcache1 was /dev/bcache0 before reboot). Therefore we need the backing device UUID (sb.uuid) to identify each bcache device.
Backing device uuid can be found by program bcache-super-show, but directly exporting backing_dev_uuid by sysfs file /sys/block/bcache<?>/bcache/backing_dev_uuid is a much simpler method.
With backing_dev_uuid, and partition uuids from /dev/disk/by-partuuid/, now we can identify each bcache device and its partitions conveniently.
--- drivers/md/bcache/sysfs.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/md/bcache/sysfs.c +9 -0
@@ -68,6 +68,7 @@ read_attribute(btree_written);read_attribute (metadata_written);read_attribute (active_journal_entries);read_attribute (backing_dev_name); +read_attribute (backing_dev_uuid);sysfs_time_stats_attribute (btree_gc, sec, ms);sysfs_time_stats_attribute (btree_split, sec, us);
@@ -250,6 +251,13 @@ SHOW(__bch_cached_dev)return strlen (buf); } +if (attr == &sysfs_backing_dev_uuid) { +/* convert binary uuid into 36-byte string plus '\0' */ +snprintf (buf,36 +1 ,"%pU" , dc->sb.uuid); +strcat (buf,"\n" ); +return strlen (buf); + } +#undef varreturn 0 ; }
@@ -460,6 +468,7 @@ static struct attribute *bch_cached_dev_files[] = { &sysfs_bypass_torture_test, #endif &sysfs_backing_dev_name, + &sysfs_backing_dev_uuid,NULL };KTYPE (bch_cached_dev);
Signature · 1 line
2.16.4
PATCH 5/19 bcache: fix indentation issue, remove tabs on a hunk of code
In reply to Coly LiFrom: Colin Ian King <[email protected]>
There is a hunk of code that is indented one level too deep, fix this by removing the extra tabs.
--- drivers/md/bcache/super.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-)
drivers/md/bcache/super.c +15 -15
@@ -1615,21 +1615,21 @@ static void conditional_stop_bcache_device(struct cache_set *c,*/ pr_warn ("stop_when_cache_set_failed of %s is \"auto\" and cache is dirty, stop it to avoid potential data corruption." , d->disk->disk_name); -/* -* There might be a small time gap that cache set is -* released but bcache device is not. Inside this time -* gap, regular I/O requests will directly go into -* backing device as no cache set attached to. This -* behavior may also introduce potential inconsistence -* data in writeback mode while cache is dirty. -* Therefore before calling bcache_device_stop() due -* to a broken cache device, dc->io_disable should be -* explicitly set to true. -*/ - dc->io_disable = true; -/* make others know io_disable is true earlier */ -smp_mb (); -bcache_device_stop (d); +/* +* There might be a small time gap that cache set is +* released but bcache device is not. Inside this time +* gap, regular I/O requests will directly go into +* backing device as no cache set attached to. This +* behavior may also introduce potential inconsistence +* data in writeback mode while cache is dirty. +* Therefore before calling bcache_device_stop() due +* to a broken cache device, dc->io_disable should be +* explicitly set to true. +*/ + dc->io_disable = true; +/* make others know io_disable is true earlier */ +smp_mb (); +bcache_device_stop (d); }else {/* * dc->stop_when_cache_set_failed == BCH_CACHED_STOP_AUTO
Signature · 1 line
2.16.4
PATCH 6/19 bcache: treat stale && dirty keys as bad keys
In reply to Coly LiFrom: Tang Junhui <[email protected]>
Stale && dirty keys can be produced in the follow way:
After writeback in write_dirty_finish(), dirty keys k1 will replace by clean keys k2
==>ret = bch_btree_insert(dc->disk.c, &keys, NULL, &w->key); ==>btree_insert_fn(struct btree_op *b_op, struct btree *b) ==>static int bch_btree_insert_node(struct btree *b,
struct btree_op *op,
struct keylist *insert_keys,
atomic_t *journal_ref,
Then two steps:
A) update k1 to k2 in btree node memory; bch_btree_insert_keys(b, op, insert_keys, replace_key)
B) Write the bset(contains k2) to cache disk by a 30s delay work bch_btree_leaf_dirty(b, journal_ref).
But before the 30s delay work write the bset to cache device, these things happened:
A) GC works, and reclaim the bucket k2 point to;
B) Allocator works, and invalidate the bucket k2 point to, and increase the gen of the bucket, and place it into free_inc fifo;
C) Until now, the 30s delay work still does not finish work, so in the disk, the key still is k1, it is dirty and stale (its gen is smaller than the gen of the bucket). and then the machine power off suddenly happens;
D) When the machine power on again, after the btree reconstruction, the stale dirty key appear.
In bch_extent_bad(), when expensive_debug_checks is off, it would treat the dirty key as good even it is stale keys, and it would cause bellow probelms:
A) In read_dirty() it would cause machine crash:
BUG_ON(ptr_stale(dc->disk.c, &w->key, 0));
B) It could be worse when reads hits stale dirty keys, it would read old incorrect data.
This patch tolerate the existence of these stale && dirty keys, and treat them as bad key in bch_extent_bad().
(Coly Li: fix indent which was modified by sender's email client)
--- drivers/md/bcache/extents.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/md/bcache/extents.c +7 -6
@@ -538,6 +538,7 @@ static bool bch_extent_bad(struct btree_keys *bk, const struct bkey *k) { struct btree *b = container_of(bk, struct btree, keys);unsigned int i, stale; +char buf[80 ];if (!KEY_PTRS (k) ||bch_extent_invalid (bk, k))
@@ -547,19 +548,19 @@ static bool bch_extent_bad(struct btree_keys *bk, const struct bkey *k)if (!ptr_available (b->c, k, i))return true; -if (!expensive_debug_checks (b->c) &&KEY_DIRTY (k)) -return false; -for (i =0 ; i <KEY_PTRS (k); i++) { stale =ptr_stale (b->c, k, i); +if (stale &&KEY_DIRTY (k)) { +bch_extent_to_text (buf,sizeof (buf), k); +pr_info ("stale dirty pointer, stale %u, key: %s" , + stale, buf); + } +btree_bug_on (stale >BUCKET_GC_GEN_MAX , b,"key too stale: %i, need_gc %u" , stale, b->c->need_gc); -btree_bug_on (stale &&KEY_DIRTY (k) &&KEY_SIZE (k), - b,"stale dirty pointer" ); -if (stale)return true;
Signature · 1 line
2.16.4
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH 06/19] bcache: treat stale && dirty keys as bad keys
Quoted 96 lines · Sasha Levin
Hi,
[This is an automated email]
This commit has been processed because it contains a -stable tag. The stable tag indicates that it's relevant for the following trees: all
The bot has tested the following trees: v4.20.7, v4.19.20, v4.14.98, v4.9.155, v4.4.173, v3.18.134.
v4.20.7: Build OK!
v4.19.20: Failed to apply! Possible dependencies:
149d0efada77("bcache: replace hard coded number withBUCKET_GC_GEN_MAX")v4.14.98: Failed to apply! Possible dependencies:
1d316e658374("bcache: implement PI controller for writeback rate")25d8be77e192("block: movebio_alloc_pages()to bcache")27a40ab9269e("bcache: addbacking_request_endio()forbi_end_io")2831231d4c3f("bcache: reducecache_setdevices iteration bydevices_max_used")3b304d24a718("bcache: convert cached_dev.count fromatomic_ttorefcount_t")3fd47bfe55b0("bcache: stopdc->writeback_rate_updateproperly")5138ac6748e3("bcache: fix misleading error message inbch_count_io_errors()")539d39eb2708("bcache: fix wrong return value inbch_debug_init()")5fa89fb9a86b("bcache: don't write back data if reading it failed")6f10f7d1b02b("bcache: style fix to replace 'unsigned' by 'unsigned int'")771f393e8ffc("bcache: addCACHE_SET_IO_DISABLEto structcache_setflags")7ba0d830dc0e("bcache: seterror_limitcorrectly")
7e027ca4b534("bcache: addstop_when_cache_set_failedoption to backing device")804f3c6981f5("bcache: fixcached_dev->countusage forbch_cache_set_error()")a8500fc816b1("bcache: rearrange writeback main thread ratelimit")b1092c9af9ed("bcache: allow quick writeback when backing idle")bc082a55d25c("bcache: fix inaccurate io state for detached bcache devices")c7b7bd07404c("bcache: addio_disableto structcached_dev")v4.9.155: Failed to apply! Possible dependencies:
1d316e658374("bcache: implement PI controller for writeback rate")2831231d4c3f("bcache: reducecache_setdevices iteration bydevices_max_used")297e3d854784("blk-throttle: makethrotl_slicetunable")3fd47bfe55b0("bcache: stopdc->writeback_rate_updateproperly")4e4cbee93d56("block: switch bios toblk_status_t")
5138ac6748e3("bcache: fix misleading error message inbch_count_io_errors()")6f10f7d1b02b("bcache: style fix to replace 'unsigned' by 'unsigned int'")7e027ca4b534("bcache: addstop_when_cache_set_failedoption to backing device")87760e5eef35("block: hook up writeback throttling")
9e234eeafbe1("blk-throttle: add a simple idle detection")c7b7bd07404c("bcache: addio_disableto structcached_dev")cf43e6be865a("block: add scalable completion tracking of requests")e806402130c9("block: split out request-only flags into a new namespace")fbbaf700e7b1("block: trace completion of all bios.")v4.4.173: Failed to apply! Possible dependencies:
005411ea7ee7("doc: updateblock/queue-sysfs.txtentries")1d316e658374("bcache: implement PI controller for writeback rate")27489a3c827b("blk-mq: turnhctx->run_workinto a regular work struct")2831231d4c3f("bcache: reducecache_setdevices iteration bydevices_max_used")297e3d854784("blk-throttle: makethrotl_slicetunable")38f8baae8905("block: factor out chained bio completion")3fd47bfe55b0("bcache: stopdc->writeback_rate_updateproperly")4e4cbee93d56("block: switch bios toblk_status_t")
511cbce2ff8b("irq_poll: make blk-iopoll available outside the block layer")5138ac6748e3("bcache: fix misleading error message inbch_count_io_errors()")6f10f7d1b02b("bcache: style fix to replace 'unsigned' by 'unsigned int'")7e027ca4b534("bcache: addstop_when_cache_set_failedoption to backing device")87760e5eef35("block: hook up writeback throttling")
8d354f133e86("blk-mq: improve layout ofblk_mq_hw_ctx")9467f85960a3("blk-mq/cpu-notif: Convert to new hotplug state machine")9e234eeafbe1("blk-throttle: add a simple idle detection")af3e3a5259e3("block: don't unecessarily clobberbi_errorfor chained bios")ba8c6967b739("block: cleanupbio_endio")
c7b7bd07404c("bcache: addio_disableto structcached_dev")cf43e6be865a("block: add scalable completion tracking of requests")e57690fe009b("blk-mq: don't overwriterq->mq_ctx")
fbbaf700e7b1("block: trace completion of all bios.")v3.18.134: Failed to apply! Possible dependencies:
0f8087ecdeac("block: Consolidate static integrity profile properties")1b94b5567e9c("Btrfs, raid56: use a variant to record the operation type")1d316e658374("bcache: implement PI controller for writeback rate")2831231d4c3f("bcache: reducecache_setdevices iteration bydevices_max_used")2c8cdd6ee4e7("Btrfs, replace: write dirty pages into the replace target device")326e1dbb5736("block: remove management ofbi_remainingwhen restoring originalbi_end_io")3fd47bfe55b0("bcache: stopdc->writeback_rate_updateproperly")4246a0b63bd8("block: add abi_errorfield to struct bio")
4e4cbee93d56("block: switch bios toblk_status_t")
5138ac6748e3("bcache: fix misleading error message inbch_count_io_errors()")5a6ac9eacb49("Btrfs, raid56: support parity scrub on raid56")
6e9606d2a2dc("Btrfs: addref_countand free function forbtrfs_bio")6f10f7d1b02b("bcache: style fix to replace 'unsigned' by 'unsigned int'")7e027ca4b534("bcache: addstop_when_cache_set_failedoption to backing device")8e5cfb55d3f7("Btrfs: Makeraid_maparray be inlined inbtrfs_biostructure")af8e2d1df984("Btrfs, scrub: repair the common data on RAID5/6 if it is corrupted")b89e1b012c7f("Btrfs, raid56: don't change bbio andraid_map")
c4cf5261f8bf("bio: skip atomic inc/dec of ->bi_remaining for non-chains")c7b7bd07404c("bcache: addio_disableto structcached_dev")
f90523d1aa3c("Btrfs: remove nousedbbio_retin__btrfs_map_blockin condition")
Quoted 1 line
How should we proceed with this patch?
Can we rebase this patch for stable kernels, and send them to stable kernel maintainers separately? If this behavior is accepted for stable kernel maintenance, I would suggest Junhui Tang to think about to rebase for these stable kernels.
Thanks.
Signature · 1 line
Coly Li
PATCH 7/19 bcache: improve sysfs_strtoul_clamp()
In reply to Coly LiCurrently sysfs_strtoul_clamp() is defined as,
82 #define sysfs_strtoul_clamp(file, var, min, max) \
83 do { \
84 if (attr == &sysfs_ ## file) \
85 return strtoul_safe_clamp(buf, var, min, max) \
86 ?: (ssize_t) size; \87 } while (0)
The problem is, if bit width of var is less then unsigned long, min and max may not protect var from integer overflow, because overflow happens in strtoul_safe_clamp() before checking min and max.
To fix such overflow in sysfs_strtoul_clamp(), to make min and max take effect, this patch adds an unsigned long variable, and uses it to macro strtoul_safe_clamp() to convert an unsigned long value in range defined by [min, max]. Then assign this value to var. By this method, if bit width of var is less than unsigned long, integer overflow won't happen before min and max are checking.
Now sysfs_strtoul_clamp() can properly handle smaller data type like unsigned int, of cause min and max should be defined in range of unsigned int too.
--- drivers/md/bcache/sysfs.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/md/bcache/sysfs.h +10 -3
@@ -81,9 +81,16 @@ do { \#define sysfs_strtoul_clamp (file, var, min, max) \ do { \ - if (attr == &sysfs_ ## file) \ - return strtoul_safe_clamp(buf, var, min, max) \ - ?: (ssize_t) size; \ + if (attr == &sysfs_ ## file) { \ + unsigned long v = 0; \ + ssize_t ret; \ + ret = strtoul_safe_clamp(buf, v, min, max); \ + if (!ret) { \ + var = v; \ + return size; \ + } \ + return ret; \ + } \ } while (0)#define strtoul_or_return (cp) \
Signature · 1 line
2.16.4
PATCH 8/19 bcache: fix input integer overflow of congested threshold
In reply to Coly LiCache set congested threshold values congested_read_threshold_us and congested_write_threshold_us can be set via sysfs interface. These two values are 'unsigned int' type, but sysfs interface uses strtoul to convert input string. So if people input a large number like 9999999999, the value indeed set is 1410065407, which is not expected behavior.
This patch replaces sysfs_strtoul() by sysfs_strtoul_clamp() when convert input string to unsigned int value, and set value range in [0, UINT_MAX], to avoid the above integer overflow errors.
--- drivers/md/bcache/sysfs.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/md/bcache/sysfs.c +6 -4
@@ -778,10 +778,12 @@ STORE(__bch_cache_set) c->shrink.scan_objects (&c->shrink, &sc); } -sysfs_strtoul (congested_read_threshold_us, - c->congested_read_threshold_us); -sysfs_strtoul (congested_write_threshold_us, - c->congested_write_threshold_us); +sysfs_strtoul_clamp (congested_read_threshold_us, + c->congested_read_threshold_us, +0 ,UINT_MAX ); +sysfs_strtoul_clamp (congested_write_threshold_us, + c->congested_write_threshold_us, +0 ,UINT_MAX );if (attr == &sysfs_errors) { v =__sysfs_match_string (error_actions,-1 , buf);
Signature · 1 line
2.16.4
PATCH 9/19 bcache: fix input overflow to sequential_cutoff
In reply to Coly LiPeople may set sequential_cutoff of a cached device via sysfs file, but current code does not check input value overflow. E.g. if value 4294967295 (UINT_MAX) is written to file sequential_cutoff, its value is 4GB, but if 4294967296 (UINT_MAX + 1) is written into, its value will be 0. This is an unexpected behavior.
This patch replaces d_strtoi_h() by sysfs_strtoul_clamp() to convert input string to unsigned integer value, and limit its range in [0, UINT_MAX]. Then the input overflow can be fixed.
--- drivers/md/bcache/sysfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/md/bcache/sysfs.c +3 -1
@@ -314,7 +314,9 @@ STORE(__cached_dev) dc->io_disable = v ?1 :0 ; } -d_strtoi_h (sequential_cutoff); +sysfs_strtoul_clamp (sequential_cutoff, + dc->sequential_cutoff, +0 ,UINT_MAX );d_strtoi_h (readahead);if (attr == &sysfs_clear_stats)
Signature · 1 line
2.16.4
PATCH 10/19 bcache: add sysfs_strtoul_bool() for setting bit-field variables
In reply to Coly LiWhen setting bool values via sysfs interface, e.g. writeback_metadata, if writing 1 into writeback_metadata file, dc->writeback_metadata is set to 1, but if writing 2 into the file, dc->writeback_metadata is
0. This is misleading, a better result should be 1 for all non-zero input value.
It is because dc->writeback_metadata is a bit-field variable, and current code simply use d_strtoul() to convert a string into integer and takes the lowest bit value. To fix such error, we need a routine to convert the input string into unsigned integer, and set target variable to 1 if the converted integer is non-zero.
This patch introduces a new macro called sysfs_strtoul_bool(), it can be used to convert input string into bool value, we can use it to set bool value for bit-field vairables.
--- drivers/md/bcache/sysfs.h | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/md/bcache/sysfs.h +10 -0
@@ -79,6 +79,16 @@ do { \return strtoul_safe (buf, var) ?: (ssize_t ) size; \ } while (0) +#define sysfs_strtoul_bool (file, var) \ +do { \ + if (attr == &sysfs_ ## file) { \ + unsigned long v = strtoul_or_return(buf); \ + \ + var = v ? 1 : 0; \ + return size; \ + } \ +} while (0) +#define sysfs_strtoul_clamp (file, var, min, max) \ do { \ if (attr == &sysfs_ ## file) { \
Signature · 1 line
2.16.4
PATCH 11/19 bcache: use sysfs_strtoul_bool() to set bit-field variables
In reply to Coly LiWhen setting bcache parameters via sysfs, there are some variables are defined as bit-field value. Current bcache code in sysfs.c uses either d_strtoul() or sysfs_strtoul() to convert the input string to unsigned integer value and set it to the corresponded bit-field value.
The problem is, the bit-field value only takes the lowest bit of the converted value. If input is 2, the expected value (like bool value) of the bit-field value should be 1, but indeed it is 0.
The following sysfs files for bit-field variables have such problem,
bypass_torture_test, for dc->bypass_torture_test writeback_metadata, for dc->writeback_metadata writeback_running, for dc->writeback_running verify, for c->verify key_merging_disabled, for c->key_merging_disabled gc_always_rewrite, for c->gc_always_rewrite btree_shrinker_disabled,for c->shrinker_disabled copy_gc_enabled, for c->copy_gc_enabled
This patch uses sysfs_strtoul_bool() to set such bit-field variables, then if the converted value is non-zero, the bit-field variables will be set to 1, like setting a bool value like expensive_debug_checks.
--- drivers/md/bcache/sysfs.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/md/bcache/sysfs.c +8 -8
@@ -277,9 +277,9 @@ STORE(__cached_dev)sysfs_strtoul (data_csum, dc->disk.data_csum);d_strtoul (verify); -d_strtoul (bypass_torture_test); -d_strtoul (writeback_metadata); -d_strtoul (writeback_running); +sysfs_strtoul_bool (bypass_torture_test, dc->bypass_torture_test); +sysfs_strtoul_bool (writeback_metadata, dc->writeback_metadata); +sysfs_strtoul_bool (writeback_running, dc->writeback_running);d_strtoul (writeback_delay); sysfs_strtoul_clamp(writeback_percent, dc->writeback_percent,
@@ -816,12 +816,12 @@ STORE(__bch_cache_set) }sysfs_strtoul (journal_delay_ms, c->journal_delay_ms); -sysfs_strtoul (verify, c->verify); -sysfs_strtoul (key_merging_disabled, c->key_merging_disabled); +sysfs_strtoul_bool (verify, c->verify); +sysfs_strtoul_bool (key_merging_disabled, c->key_merging_disabled);sysfs_strtoul (expensive_debug_checks, c->expensive_debug_checks); -sysfs_strtoul (gc_always_rewrite, c->gc_always_rewrite); -sysfs_strtoul (btree_shrinker_disabled, c->shrinker_disabled); -sysfs_strtoul (copy_gc_enabled, c->copy_gc_enabled); +sysfs_strtoul_bool (gc_always_rewrite, c->gc_always_rewrite); +sysfs_strtoul_bool (btree_shrinker_disabled, c->shrinker_disabled); +sysfs_strtoul_bool (copy_gc_enabled, c->copy_gc_enabled);/* * write gc_after_writeback here may overwrite an already set * BCH_DO_AUTO_GC, it doesn't matter because this flag will be
Signature · 1 line
2.16.4
PATCH 12/19 bcache: fix input overflow to writeback_delay
In reply to Coly LiSysfs file writeback_delay is used to configure dc->writeback_delay which is type unsigned int. But bcache code uses sysfs_strtoul() to convert the input string, therefore it might be overflowed if the input value is too large. E.g. input value is 4294967296 but indeed 0 is set to dc->writeback_delay.
This patch uses sysfs_strtoul_clamp() to convert the input string and set the result value range in [0, UINT_MAX] to avoid such unsigned integer overflow.
--- drivers/md/bcache/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/bcache/sysfs.c +1 -1
@@ -280,7 +280,7 @@ STORE(__cached_dev)sysfs_strtoul_bool (bypass_torture_test, dc->bypass_torture_test);sysfs_strtoul_bool (writeback_metadata, dc->writeback_metadata);sysfs_strtoul_bool (writeback_running, dc->writeback_running); -d_strtoul (writeback_delay); +sysfs_strtoul_clamp (writeback_delay, dc->writeback_delay,0 ,UINT_MAX );sysfs_strtoul_clamp (writeback_percent, dc->writeback_percent,0 , bch_cutoff_writeback);
Signature · 1 line
2.16.4
PATCH 13/19 bcache: fix potential div-zero error of writeback_rate_i_term_inverse
In reply to Coly Lidc->writeback_rate_i_term_inverse can be set via sysfs interface. It is in type unsigned int, and convert from input string by d_strtoul(). The problem is d_strtoul() does not check valid range of the input, if 4294967296 is written into sysfs file writeback_rate_i_term_inverse, an overflow of unsigned integer will happen and value 0 is set to dc->writeback_rate_i_term_inverse.
In writeback.c:__update_writeback_rate(), there are following lines of code,
integral_scaled = div_s64(dc->writeback_rate_integral,
dc->writeback_rate_i_term_inverse);If dc->writeback_rate_i_term_inverse is set to 0 via sysfs interface, a div-zero error might be triggered in the above code.
Therefore we need to add a range limitation in the sysfs interface, this is what this patch does, use sysfs_stroul_clamp() to replace d_strtoul() and restrict the input range in [1, UINT_MAX].
--- drivers/md/bcache/sysfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/md/bcache/sysfs.c +3 -1
@@ -302,7 +302,9 @@ STORE(__cached_dev)sysfs_strtoul_clamp (writeback_rate_update_seconds, dc->writeback_rate_update_seconds,1 ,WRITEBACK_RATE_UPDATE_SECS_MAX ); -d_strtoul (writeback_rate_i_term_inverse); +sysfs_strtoul_clamp (writeback_rate_i_term_inverse, + dc->writeback_rate_i_term_inverse, +1 ,UINT_MAX );d_strtoul_nonzero (writeback_rate_p_term_inverse);d_strtoul_nonzero (writeback_rate_minimum);
Signature · 1 line
2.16.4
PATCH 14/19 bcache: fix potential div-zero error of writeback_rate_p_term_inverse
In reply to Coly LiCurrent code already uses d_strtoul_nonzero() to convert input string to an unsigned integer, to make sure writeback_rate_p_term_inverse won't be zero value. But overflow may happen when converting input string to an unsigned integer value by d_strtoul_nonzero(), then dc->writeback_rate_p_term_inverse can still be set to 0 even if the sysfs file input value is not zero, e.g. 4294967296 (a.k.a UINT_MAX+1).
If dc->writeback_rate_p_term_inverse is set to 0, it might cause a dev-zero error in following code from __update_writeback_rate(),
int64_t proportional_scaled = div_s64(error, dc->writeback_rate_p_term_inverse);
This patch replaces d_strtoul_nonzero() by sysfs_strtoul_clamp() and limit the value range in [1, UINT_MAX]. Then the unsigned integer overflow and dev-zero error can be avoided.
--- drivers/md/bcache/sysfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/md/bcache/sysfs.c +3 -1
@@ -305,7 +305,9 @@ STORE(__cached_dev)sysfs_strtoul_clamp (writeback_rate_i_term_inverse, dc->writeback_rate_i_term_inverse,1 ,UINT_MAX ); -d_strtoul_nonzero (writeback_rate_p_term_inverse); +sysfs_strtoul_clamp (writeback_rate_p_term_inverse, + dc->writeback_rate_p_term_inverse, +1 ,UINT_MAX );d_strtoul_nonzero (writeback_rate_minimum);sysfs_strtoul_clamp (io_error_limit, dc->error_limit,0 ,INT_MAX );
Signature · 1 line
2.16.4
PATCH 15/19 bcache: fix input overflow to writeback_rate_minimum
In reply to Coly Lidc->writeback_rate_minimum is type unsigned integer variable, it is set via sysfs interface, and converte from input string to unsigned integer by d_strtoul_nonzero(). When the converted input value is larger than UINT_MAX, overflow to unsigned integer happens.
This patch fixes the overflow by using sysfs_strotoul_clamp() to convert input string and limit the value in range [1, UINT_MAX], then the overflow can be avoided.
--- drivers/md/bcache/sysfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/md/bcache/sysfs.c +3 -1
@@ -308,7 +308,9 @@ STORE(__cached_dev)sysfs_strtoul_clamp (writeback_rate_p_term_inverse, dc->writeback_rate_p_term_inverse,1 ,UINT_MAX ); -d_strtoul_nonzero (writeback_rate_minimum); +sysfs_strtoul_clamp (writeback_rate_minimum, + dc->writeback_rate_minimum, +1 ,UINT_MAX );sysfs_strtoul_clamp (io_error_limit, dc->error_limit,0 ,INT_MAX );
Signature · 1 line
2.16.4
PATCH 16/19 bcache: fix input overflow to journal_delay_ms
In reply to Coly Lic->journal_delay_ms is in type unsigned short, it is set via sysfs interface and converted by sysfs_strtoul() from input string to unsigned short value. Therefore overflow to unsigned short might be happen when the converted value exceed USHRT_MAX. e.g. writing 65536 into sysfs file journal_delay_ms, c->journal_delay_ms is set to 0.
This patch uses sysfs_strtoul_clamp() to convert the input string and limit value range in [0, USHRT_MAX], to avoid the input overflow.
--- drivers/md/bcache/sysfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/md/bcache/sysfs.c +3 -1
@@ -821,7 +821,9 @@ STORE(__bch_cache_set) } } -sysfs_strtoul (journal_delay_ms, c->journal_delay_ms); +sysfs_strtoul_clamp (journal_delay_ms, + c->journal_delay_ms, +0 ,USHRT_MAX );sysfs_strtoul_bool (verify, c->verify);sysfs_strtoul_bool (key_merging_disabled, c->key_merging_disabled);sysfs_strtoul (expensive_debug_checks, c->expensive_debug_checks);
Signature · 1 line
2.16.4
PATCH 17/19 bcache: fix input overflow to cache set io_error_limit
In reply to Coly Lic->error_limit is in type unsigned int, it is set via cache set sysfs file io_error_limit. Inside the bcache code, input string is converted by strtoul_or_return() and set the converted value to c->error_limit.
Because the converted value is unsigned long, and c->error_limit is unsigned int, if the input is large enought, overflow will happen to c->error_limit.
This patch uses sysfs_strtoul_clamp() to convert input string, and set the range in [0, UINT_MAX] to avoid the potential overflow.
--- drivers/md/bcache/sysfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/md/bcache/sysfs.c +1 -2
@@ -801,8 +801,7 @@ STORE(__bch_cache_set) c->on_error = v; } -if (attr == &sysfs_io_error_limit) - c->error_limit =strtoul_or_return (buf); +sysfs_strtoul_clamp (io_error_limit, c->error_limit,0 ,UINT_MAX );/* See count_io_errors() for why 88 */ if (attr == &sysfs_io_error_halflife)
Signature · 1 line
2.16.4
PATCH 18/19 bcache: fix input overflow to cache set sysfs file io_error_halflife
In reply to Coly LiCache set sysfs entry io_error_halflife is used to set c->error_decay. c->error_decay is in type unsigned int, and it is converted by strtoul_or_return(), therefore overflow to c->error_decay is possible for a large input value.
This patch fixes the overflow by using strtoul_safe_clamp() to convert input string to an unsigned long value in range [0, UINT_MAX], then divides by 88 and set it to c->error_decay.
--- drivers/md/bcache/sysfs.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/md/bcache/sysfs.c +11 -2
@@ -804,8 +804,17 @@ STORE(__bch_cache_set)sysfs_strtoul_clamp (io_error_limit, c->error_limit,0 ,UINT_MAX );/* See count_io_errors() for why 88 */ -if (attr == &sysfs_io_error_halflife) - c->error_decay =strtoul_or_return (buf) /88 ; +if (attr == &sysfs_io_error_halflife) { +unsigned long v =0 ; +ssize_t ret; + + ret =strtoul_safe_clamp (buf, v,0 ,UINT_MAX ); +if (!ret) { + c->error_decay = v /88 ; +return size; + } +return ret; + }if (attr == &sysfs_io_disable) { v =strtoul_or_return (buf);
Signature · 1 line
2.16.4
PATCH 19/19 bcache: use (REQ_META|REQ_PRIO) to indicate bio for metadata
In reply to Coly LiIn 'commit 752f66a75aba ("bcache: use REQ_PRIO to indicate bio for metadata")' REQ_META is replaced by REQ_PRIO to indicate metadata bio. This assumption is not always correct, e.g. XFS uses REQ_META to mark metadata bio other than REQ_PRIO. This is why Nix noticed that bcache does not cache metadata for XFS after the above commit.
Thanks to Dave Chinner, he explains the difference between REQ_META and REQ_PRIO from view of file system developer. Here I quote part of his explanation from mailing list,
REQ_META is used for metadata. REQ_PRIO is used to communicate to the lower layers that the submitter considers this IO to be more important that non REQ_PRIO IO and so dispatch should be expedited.
IOWs, if the filesystem considers metadata IO to be more important that user data IO, then it will use REQ_PRIO | REQ_META rather than just REQ_META.
Then it seems bios with REQ_META or REQ_PRIO should both be cached for performance optimation, because they are all probably low I/O latency demand by upper layer (e.g. file system).
So in this patch, when we want to decide whether to bypass the cache, REQ_META and REQ_PRIO are both checked. Then both metadata and high priority I/O requests will be handled properly.
--- drivers/md/bcache/request.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/md/bcache/request.c +4 -3
@@ -392,10 +392,11 @@ static bool check_should_bypass(struct cached_dev *dc, struct bio *bio)/* * Flag for bypass if the IO is for read-ahead or background, -* unless the read-ahead request is for metadata (eg, for gfs2). +* unless the read-ahead request is for metadata +* (eg, for gfs2 or xfs). */ if (bio->bi_opf & (REQ_RAHEAD |REQ_BACKGROUND ) && - !(bio->bi_opf &REQ_PRIO )) + !(bio->bi_opf & (REQ_META |REQ_PRIO ))) goto skip; if (bio->bi_iter.bi_sector & (c->sb.block_size - 1) ||
@@ -877,7 +878,7 @@ static int cached_dev_cache_miss(struct btree *b, struct search *s, }if (!(bio->bi_opf &REQ_RAHEAD ) && - !(bio->bi_opf &REQ_PRIO ) && + !(bio->bi_opf & (REQ_META |REQ_PRIO )) && s->iop.c->gc_stats.in_use <CUTOFF_CACHE_READA ) reada =min_t (sector_t, dc->readahead >>9 ,get_capacity (bio->bi_disk) -bio_end_sector (bio));
Signature · 1 line
2.16.4
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH 19/19] bcache: use (REQ_META|REQ_PRIO) to indicate bio for metadata
Quoted 58 lines · Sasha Levin
Hi,
[This is an automated email]
This commit has been processed because it contains a -stable tag. The stable tag indicates that it's relevant for the following trees: all
The bot has tested the following trees: v4.20.7, v4.19.20, v4.14.98, v4.9.155, v4.4.173, v3.18.134.
v4.20.7: Build OK!
v4.19.20: Failed to apply! Possible dependencies:
752f66a75aba("bcache: useREQ_PRIOto indicate bio for metadata")v4.14.98: Failed to apply! Possible dependencies:
752f66a75aba("bcache: useREQ_PRIOto indicate bio for metadata")b41c9b0266e8("bcache: updatebio->bi_opfbypass/writebackREQ_flag hints")v4.9.155: Failed to apply! Possible dependencies:
752f66a75aba("bcache: useREQ_PRIOto indicate bio for metadata")83b5df67c509("bcache: useop_is_syncto check for synchronous requests")b41c9b0266e8("bcache: updatebio->bi_opfbypass/writebackREQ_flag hints")v4.4.173: Failed to apply! Possible dependencies:
09cbfeaf1a5a("mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros")1c2e54e1ed6f("dm thin: bump thin and thin-pool target versions")1eff9d322a44("block: rename biobi_rwtobi_opf")
202bae52934d("dm thin: unrollissue_discard()to create longer discard bio chains")38f252553300("block: add__blkdev_issue_discard")
3dba53a958a7("dm thin: use__blkdev_issue_discardfor async discard support")4e49ea4a3d27("block/fs/drivers: remove rw argument fromsubmit_bio")83b5df67c509("bcache: useop_is_syncto check for synchronous requests")9082e87bfbf8("block: remove structbio_batch")
a6111d11b8b5("btrfs: raid56: Useraid_write_end_iofor scrub")b41c9b0266e8("bcache: updatebio->bi_opfbypass/writebackREQ_flag hints")bbd848e0fade("block: reinstate early return of-EOPNOTSUPPfromblkdev_issue_discard")c3667cc61904("dm thin: consistently return-ENOSPCif pool has run out of data space")c8d93247f1d0("bcache: useop_is_writeinstead of checking forREQ_WRITE")d57d611505d9("kernel/fs: fix I/O wait not accounted for RWO_DSYNC")v3.18.134: Failed to apply! Possible dependencies:
1b94b5567e9c("Btrfs, raid56: use a variant to record the operation type")
1eff9d322a44("block: rename biobi_rwtobi_opf")
2c8cdd6ee4e7("Btrfs, replace: write dirty pages into the replace target device")326e1dbb5736("block: remove management ofbi_remainingwhen restoring originalbi_end_io")4245215d6a8d("Btrfs, raid56: fix use-after-free problem in the final device replace procedure on raid56")5a6ac9eacb49("Btrfs, raid56: support parity scrub on raid56")
6e9606d2a2dc("Btrfs: addref_countand free function forbtrfs_bio")
83b5df67c509("bcache: useop_is_syncto check for synchronous requests")
8e5cfb55d3f7("Btrfs: Makeraid_maparray be inlined inbtrfs_biostructure")af8e2d1df984("Btrfs, scrub: repair the common data on RAID5/6 if it is corrupted")b41c9b0266e8("bcache: updatebio->bi_opfbypass/writebackREQ_flag hints")b7c44ed9d2fc("block: manipulatebio->bi_flagsthrough helpers")
b89e1b012c7f("Btrfs, raid56: don't change bbio andraid_map")
c4cf5261f8bf("bio: skip atomic inc/dec of ->bi_remaining for non-chains")
c8d93247f1d0("bcache: useop_is_writeinstead of checking forREQ_WRITE")
f90523d1aa3c("Btrfs: remove nousedbbio_retin__btrfs_map_blockin condition")
Quoted 1 line
How should we proceed with this patch?
Can I rebase this patch for each stable kernel, and send the patch to [email protected] ?
Thanks.
Signature · 1 line
Coly Li
Quoted 4 lines · Coly Li
Hi Jens,
This is the bcache patch set for Linux v5.1 merge window.
Quoted 9 lines
In this series, we have 4 majour contributers for 19 changes,
- Colin Ian King contributes a patch to improve indent format.
- Danial Axtens fixes a bug by not caching DISCARD/TRIM bio onto cache device, to avoid an oops in block layer code.
- Junhui Tang contributes a fix which removes a bogusBUG_ON()panic by stale and dirty keys.
- I fixes a series of input overflow issues in bcache sysfs interface, and export backing device uuid and name for user space tool. There also is a patch to fix caching read ahead metadata issue for XFS.
Applied, thanks Coly.
Signature · 1 line
Jens Axboe