Bug 9363
Summary: | BFS: filesystem driver ignores the block device size. | ||
---|---|---|---|
Product: | File System | Reporter: | Dmitri Vorobiev (dmitri.vorobiev) |
Component: | Other | Assignee: | Dmitri Vorobiev (dmitri.vorobiev) |
Status: | RESOLVED CODE_FIX | ||
Severity: | high | CC: | dmitri.vorobiev |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 2.6.24-rc2 | Subsystem: | |
Regression: | --- | Bisected commit-id: |
Description
Dmitri Vorobiev
2007-11-13 06:34:33 UTC
The bfs_get_block() function located in `fs/bfs/file.c' does not compare the number of the physical block, which it tries to access when extending the file, against the size of the block device. Checks against the block device size need to be introduced into the filesystem driver, and -ENOSPC error should be returned every time the partition runs out of free space when writing a growing file. The patch, which fixes this problem will soon be submitted, I am working on that. The patch proposed in the following LKML message http://lkml.org/lkml/2007/11/13/185 fixes the error reported in the context of this bug. What follows is a console session, which proves that the error is gone: >>> debian:~# mount -t bfs /dev/loop0 /mnt debian:~# cd /mnt debian:/mnt# mount | grep mnt /dev/loop0 on /mnt type bfs (rw) debian:/mnt# df -B 512 | grep loop /dev/loop0 65536 81 65455 1% /mnt debian:/mnt# dd if=/dev/zero of=/mnt/1 bs=512 count=65456 dd: writing `/mnt/1': No space left on device 65456+0 records in 65455+0 records out 33512960 bytes (34 MB) copied, 7.07956 seconds, 4.7 MB/s debian:/mnt# df -B 512 | grep loop /dev/loop0 65536 65536 0 100% /mnt debian:/mnt# <<< I merged Dmitri's fix. |