Commit ff269568 authored by Mike Snitzer's avatar Mike Snitzer Committed by Jens Axboe
Browse files

brd: remove support for BLKFLSBUF

Discontinue having the brd driver destructively free all pages in the
ramdisk in response to the BLKFLSBUF ioctl.  Doing so allows a BLKFLSBUF
ioctl issued to a logical partition to destroy pages of the parent brd
device (and all other partitions of that brd device).

This change breaks compatibility - but in this case the compatibility
breaks more than it helps.

Reported-by: default avatarMikulas Patocka <>
Suggested-by: default avatarChristoph Hellwig <>
Signed-off-by: default avatarMike Snitzer <>
Signed-off-by: default avatarJens Axboe <>
parent 366f4aea
......@@ -395,44 +395,9 @@ static long brd_direct_access(struct block_device *bdev, sector_t sector,
#define brd_direct_access NULL
static int brd_ioctl(struct block_device *bdev, fmode_t mode,
unsigned int cmd, unsigned long arg)
int error;
struct brd_device *brd = bdev->bd_disk->private_data;
if (cmd != BLKFLSBUF)
return -ENOTTY;
* ram device BLKFLSBUF has special semantics, we want to actually
* release and destroy the ramdisk data.
error = -EBUSY;
if (bdev->bd_openers <= 1) {
* Kill the cache first, so it isn't written back to the
* device.
* Another thread might instantiate more buffercache here,
* but there is not much we can do to close that race.
error = 0;
return error;
static const struct block_device_operations brd_fops = {
.owner = THIS_MODULE,
.rw_page = brd_rw_page,
.ioctl = brd_ioctl,
.direct_access = brd_direct_access,
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment