Le 02/10/2017 à 11:46, Goffredo Baroncelli a écrit : > On 10/02/2017 07:59 PM, Jean-Denis Girard wrote: >> Le 30/09/2017 à 17:29, Jean-Denis Girard a écrit : >>> Le 28/09/2017 à 19:26, Jean-Denis Girard a écrit : >>> The problem seems to come from commit c821e7f3 "pass bytes to >>> btrfs_bio_alloc" (https://patchwork.kernel.org/patch/9763081/): the >>> system is now running fine on 4.13.4 with only that patch reverted. >> >> Same situation with 4.14-rc3: my system cannot mount root file-system. >> If I revert the patch, the system boots normally. This is 100% >> reproducible. How can I help resolve that issue? > > > Looking at the patch, it seems suspect this chunk: > > @@ -2798,7 +2798,7 @@ static int submit_extent_page(int op, int op_flags, > struct extent_io_tree *tree, > } > } > > - bio = btrfs_bio_alloc(bdev, sector); > + bio = btrfs_bio_alloc(bdev, sector << 9); > bio_add_page(bio, page, page_size, offset); > bio->bi_end_io = end_io_func; > bio->bi_private = tree; > > Now sector, is defined as > > sector_t [1] > > which in turn it might be defined as > > unsigned long [2] > > which on 32bit is 32 bit if CONFIG_LBDAF is _not_ defined (CONFIG_LBDAF == > Support for large (2TB+) block devices and files) > > The point is that > > sector << 9 > > may overflow if the disk is bigger than 4GB (and in your case it seems to be > 8 GB). > > If I am correct, could you please so kindly to > > - repllay the patch > - AND try to replace > bio = btrfs_bio_alloc(bdev, sector << 9); > with > bio = btrfs_bio_alloc(bdev, (u64)sector << 9);
Hi Goffredo, Thanks for your reply, analysis and correction: it does work, tested on 4.13-rc3, my system boots fine. Best regards, -- Jean-Denis Girard SysNux Systèmes Linux en Polynésie française https://www.sysnux.pf/ Tél: +689 40.50.10.40 / GSM: +689 87.797.527 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html