[DRBD-user] BLKFLSBUF: Inappropriate ioctl for device (when executing blockdev --flushbufs)

Lars Ellenberg Lars.Ellenberg at linbit.com
Thu Sep 28 11:18:07 CEST 2006

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


/ 2006-09-27 17:34:57 +0200
\ Werner Fischer:
> On Wed, 2006-09-27 at 17:19 +0200, Lars Ellenberg wrote:
> > I just did 
> > # blockdev --flushbufs /dev/drbd0
> > # echo $?
> > 0
> > 
> > on our file server here.
> > so it _does_ "just work".
> > 
> > what is your kernel?
> OpenVZ Kernel 2.6.8-022stab078.14 (http://openvz.org/)
> 
> > which drbd version?
> 0.7.20
> 
> [root at node1 ~]# blockdev --flushbufs /dev/drbd0
> BLKFLSBUF: Inappropriate ioctl for device
> [root at node1 ~]# cat /proc/version
> Linux version 2.6.8-022stab078.14 (root at kern268.build.sw.ru) (gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7)) #1 Wed Jul 19 16:02:34 MSD 2006

> As it seems to work on your side, maybe it has something to do with the
> OpenVZ kernel?

the reason it "works" here, and not for you is probably this,
from kernel ChangeLog-2.6.9:
<ecashin at coraid.com>
 [PATCH] fix block layer ioctl bug

 If the blockdev doesn't implement BLKFLSBUF and returns -ENOTTY we should
 still go ahead and perform the VFS-level sync.  We need to test for both
 ENOTTY and EINVAL because some SCSI drivers incorrectly return EINVAL.

 Signed-off-by: Ed L Cashin <ecashin at coraid.com>
 Signed-off-by: Andrew Morton <akpm at osdl.org>
 Signed-off-by: Linus Torvalds <torvalds at osdl.org>

> On your side: what does DRBD upon "blockdev --flushbufs /dev/drbd0" - 
> does DRBD forward the flush command to the lower devices?

DRBD does nothing but return ENOTTY...
Maybe we want to put something in there, like you suggest.
but (for kernels including the patch mentioned above),
block/ioctl.c blkdev_ioctl() does the right thing, namely:
    lock_kernel();
    fsync_bdev(bdev);
    invalidate_bdev(bdev, 0);
    unlock_kernel();
    return 0;

so I think there is no hurry...

-- 
: Lars Ellenberg                                  Tel +43-1-8178292-0  :
: LINBIT Information Technologies GmbH            Fax +43-1-8178292-82 :
: Schoenbrunner Str. 244, A-1120 Vienna/Europe   http://www.linbit.com :
__
please use the "List-Reply" function of your email client.



More information about the drbd-user mailing list