Linux bcache driver list
 help / color / mirror / Atom feed
* bcache detach lead to xfs force shutdown
@ 2022-02-21  9:33 Zhang Zhen
  2022-02-23  9:03 ` Coly Li
  0 siblings, 1 reply; 13+ messages in thread
From: Zhang Zhen @ 2022-02-21  9:33 UTC (permalink / raw)
  To: colyli; +Cc: linux-bcache, jianchao.wan9

Hi coly,

We encounted a bcache detach problem, during the io process,the cache 
device become missing.

The io error status returned to xfs, and in some case, the xfs do force 
shutdown.

The dmesg as follows:
Feb  2 20:59:23  kernel: bcache: bch_count_io_errors() nvme0n1p56: IO 
error on writing btree.
Feb  2 20:59:23  kernel: bcache: bch_count_io_errors() nvme0n1p44: IO 
error on writing btree.
Feb  2 20:59:23  kernel: bcache: bch_count_io_errors() nvme0n1p44: IO 
error on writing btree.
Feb  2 20:59:23  kernel: bcache: bch_count_io_errors() nvme0n1p57: IO 
error on writing btree.
Feb  2 20:59:23  kernel: bcache: bch_count_io_errors() nvme0n1p56: IO 
error on writing btree.
Feb  2 20:59:23  kernel: bcache: bch_count_io_errors() nvme0n1p57: IO 
error on writing btree.
Feb  2 20:59:23  kernel: bcache: bch_count_io_errors() nvme0n1p56: IO 
error on writing btree.
Feb  2 20:59:23  kernel: bcache: bch_btree_insert() error -5
Feb  2 20:59:23  kernel: XFS (bcache43): metadata I/O error in 
"xfs_buf_iodone_callback_error" at daddr 0x80034658 len 32 error 12
Feb  2 20:59:23  kernel: bcache: bch_btree_insert() error -5
Feb  2 20:59:23  kernel: bcache: bch_btree_insert() error -5
Feb  2 20:59:23  kernel: bcache: bch_btree_insert() error -5
Feb  2 20:59:23  kernel: bcache: bch_btree_insert() error -5
Feb  2 20:59:23  kernel: bcache: bch_cache_set_error() bcache: error on 
004f8aa7-561a-4ba7-bf7b-292e461d3f18:
Feb  2 20:59:23  kernel: journal io error
Feb  2 20:59:23  kernel: bcache: bch_cache_set_error() , disabling caching
Feb  2 20:59:23  kernel: bcache: bch_btree_insert() error -5
Feb  2 20:59:23  kernel: bcache: conditional_stop_bcache_device() 
stop_when_cache_set_failed of bcache43 is "auto" and cache is clean, 
keep it alive.
Feb  2 20:59:23  kernel: XFS (bcache43): metadata I/O error in 
"xlog_iodone" at daddr 0x400123e60 len 64 error 12
Feb  2 20:59:23  kernel: XFS (bcache43): xfs_do_force_shutdown(0x2) 
called from line 1298 of file fs/xfs/xfs_log.c. Return address = 
00000000c1c8077f
Feb  2 20:59:23  kernel: XFS (bcache43): Log I/O Error Detected. 
Shutting down filesystem
Feb  2 20:59:23  kernel: XFS (bcache43): Please unmount the filesystem 
and rectify the problem(s)


We checked the code, the error status is returned in 
cached_dev_make_request and closure_bio_submit function.

1180 static blk_qc_t cached_dev_make_request(struct request_queue *q,
1181                     struct bio *bio)
1182 {
1183     struct search *s;
1184     struct bcache_device *d = bio->bi_disk->private_data;
1185     struct cached_dev *dc = container_of(d, struct cached_dev, disk);
1186     int rw = bio_data_dir(bio);
1187
1188     if (unlikely((d->c && test_bit(CACHE_SET_IO_DISABLE, 
&d->c->flags)) ||
1189              dc->io_disable)) {
1190         bio->bi_status = BLK_STS_IOERR;
1191         bio_endio(bio);
1192         return BLK_QC_T_NONE;
1193     }

  901 static inline void closure_bio_submit(struct cache_set *c,
  902                       struct bio *bio,
  903                       struct closure *cl)
  904 {
  905     closure_get(cl);
  906     if (unlikely(test_bit(CACHE_SET_IO_DISABLE, &c->flags))) {
  907         bio->bi_status = BLK_STS_IOERR;
  908         bio_endio(bio);
  909         return;
  910     }
  911     generic_make_request(bio);
  912 }

Can the cache set detached and don't return error status to fs?

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-03-10  2:01 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-21  9:33 bcache detach lead to xfs force shutdown Zhang Zhen
2022-02-23  9:03 ` Coly Li
2022-02-23 12:26   ` Zhang Zhen
2022-03-02  9:19     ` Coly Li
2022-03-03 17:42       ` Nix
2022-03-04  8:22       ` Zhang Zhen
2022-03-04  8:42         ` Coly Li
2022-03-07  7:56           ` zhangzhen.email
2022-03-07  8:21             ` Coly Li
2022-03-07  9:06               ` zhangzhen.email
2022-03-07  9:16               ` [PATCH] Bcache: don't return BLK_STS_IOERR during cache detach Zhen Zhang
2022-03-09 13:14     ` bcache detach lead to xfs force shutdown Coly Li
2022-03-10  2:01       ` Zhang Zhen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox