Re: [PATCH] s390: Hypervisor File System

From: Andrew Morton
Date: Fri Apr 28 2006 - 15:53:43 EST


Michael Holzheu <HOLZHEU@xxxxxxxxxx> wrote:
>
> > > + if (filp->f_mode & FMODE_WRITE) {
> > > + if (!(inode->i_mode & S_IWUGO))
> > > + return -EACCES;
> > > + }
> > > + if (filp->f_mode & FMODE_READ) {
> > > + if (!(inode->i_mode & S_IRUGO))
> > > + return -EACCES;
> > > + }
> >
> > Is the standard VFS permission checking not appropriate?
> >
> > (A comment should be added here).
>
> You mean using .permission in the inode operations
> and using the generic_permission() function?
>
> Currently I do not have own inode operations (and
> I don't want to have them ...)

The VFS-level open() code implements standard permission-checking so I
_think_ you don't need to do anything in here. See how ramfs does it.

ramfs does have an inode_operations, for ->getattr() support. So it can
return a correct number in stat->blocks.

sysfs implements inode_operations, so it can do stuff in ->setattr().

I don't think hypfs needs either of those, so you still shouldn't need a
file_inode_operations.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/