svn commit: r204638 - head/sys/kern

John Baldwin jhb at freebsd.org
Wed Mar 3 16:59:13 UTC 2010


On Wednesday 03 March 2010 11:18:05 am John Baldwin wrote:
> Author: jhb
> Date: Wed Mar  3 16:18:04 2010
> New Revision: 204638
> URL: http://svn.freebsd.org/changeset/base/204638
> 
> Log:
>   Allow lseek(SEEK_END) to work on disk devices by using the DIOCGMEDIASIZE
>   to determine the media size.

I tried changing devfs_getattr() to return the media size in va_size at 
Bruce's suggestion, but that ended up not being safe.  Specifically, one can 
only issue DIOCGMEDIASIZE safely if one has an open file handle on a device, 
and a plain stat(2) (vs fstat(2) or lseek(2)) invokes VOP_GETATTR() without 
having the file open.

-- 
John Baldwin


More information about the svn-src-head mailing list