login
Header Space

 
 

Re: [PATCH] mm: fix blkdev size calculation in generic_write_checks

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>
Cc: <linux-kernel@...>, <axboe@...>
Date: Wednesday, February 27, 2008 - 6:13 am

On 15:49 Tue 26 Feb     , Andrew Morton wrote:
In fact original issue (wich was reported by me) stil exist
# uname -a
Linux ts52 2.6.25-rc3 #8 SMP Wed Feb 27 11:41:29 MSK 2008 x86_64 x86_64 x86_64
GNU/Linux
# blockdev --getsz /dev/sda7 
208782
# blockdev --getbsz /dev/sda7 
4096
# dd if=/dev/zero of=/dev/sda7 bs=1k seek=104390 count=1
dd: writing `/dev/sda7': Input/output error
1+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000918887 seconds, 0.0 kB/s

This issue triggered in blkdev_get_block(), which is VFS layer

Issue from the bug was triggered in 
__generic_make_request()
  ->bio_check_eod()
    ->handle_bad_sector()
###Bug's log:
Feb 26 19:17:25 tux attempt to access beyond end of device
Feb 26 19:17:25 tux sr0: rw=0, want=4911744, limit=2097151
###Corresponding code:
 printk(KERN_INFO "%s: rw=%ld, want=%Lu, limit=%Lu\n",
                        bdevname(bio->bi_bdev, b),
                        bio->bi_rw,
                        (unsigned long long)bio->bi_sector + bio_sectors(bio),
                        (long long)(bio->bi_bdev->bd_inode->i_size >> 9));
This means that all vfs checks was already done 
(iblock >=max_block(I_BDEV(inode))) was TRUE at this time.
But during __generic_make_request() we have found what "want" was more whan x2
times biger than "limit". 
IMHO: this may happens because of bug in DVD driver itself.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] mm: fix blkdev size calculation in generic_write..., Dmitri Monakhov, (Wed Feb 27, 6:13 am)
speck-geostationary