Bug 9364
Summary: | BFS: Deleting an empty file erroneously increases the number of free blocks reported by statfs(). | ||
---|---|---|---|
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:45:04 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. I am working on a fix for the BFS driver, that's why I am assigning this bug to myself now. 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# df -B 512 | grep loop /dev/loop0 65536 81 65455 1% /mnt debian:/mnt# for i in `seq 1 100`; do touch file; rm file; done debian:/mnt# df -B 512 | grep loop /dev/loop0 65536 81 65455 1% /mnt debian:/mnt# <<< I merged Dmitry's fix |