Blocking the access to the device files.

mindentropy mindentropy at gmail.com
Wed Dec 29 13:54:12 EST 2010


On Wednesday 29 Dec 2010 10:31:37 pm Greg Freemyer wrote:
> On Wed, Dec 29, 2010 at 11:12 AM, Mulyadi Santosa
> 
> <mulyadi.santosa at gmail.com> wrote:
> > On Wed, Dec 29, 2010 at 20:06, Prasad Joshi <prasadjoshi124 at gmail.com> 
wrote:
> >> Hello All,
> >> 
> >> ZFS file system has a property called devices. If turned off, ZFS
> >> would not allow access to the device files (block/character) present
> >> on the file system. I want to implement the same behavior on the a
> >> Linux File System.
> > 
> > I don't know about ZFS, so could you please elaborate on what you mean
> > by "ZFS could disallow access"?
> > 
> > IMHO, (untested), you could simply do it using usual Linux
> > file/directory permission up to SELinux/AppArmor....so, is that what
> > you mean?
> > 
> > --
> > regards,
> > 
> > Mulyadi Santosa
> 
> Mulyadi,
> 
> My guess is that it is more complex than that.
> 
> Some filesystems have issues if the raw drive is read while the
> filesystem is mounted.  I think it is caused by inconsistencies in the
> various cache's.  ie. iirc, At least in the 2.4 kernel there was not a
> single unified cache for block layer and filesystems.  So doing raw
> reads of underlying device while it was mounted could cause the caches
> to get out of sync.
> 
> I don't recall the details, but either the kernel would oops or the
> filesystem would become corrupt.  I don't know if any 2.6 filesystems
> still have that issue.  Anyway ZFS must have a similar issue.
> 
> So a ZFS filesystem developer knowing this was a conflict could add a
> check in the /dev/sda open() that would fail the open if there was a
> mounted filesystem of type ZFS on the drive.
> 
> And the mount should fail if /dev/sda is already open.
> 
> I'm not aware of the 2.6.x linux kernel offering any infrastructure to
> help with that issue.
> 
> Greg
> 
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Greg,
> So doing raw
> reads of underlying device while it was mounted could cause the caches
> to get out of sync.

    So doing a 'dd' would cause the kernel to oops?

Thanks.



More information about the Kernelnewbies mailing list