Minor fixes to linux/fs/dquot.c (5.6.0)

Chris Rankin (rankinc@bellsouth.net)
Sun, 15 Feb 1998 23:47:46 -0500


Hello again,

I stumbled across these few lines in the quota_on() routine. They have the potential to cause problems in the future:

if ((filp = get_empty_filp()) != (struct file *)NULL) {
filp->f_mode = (O_RDWR + 1) & O_ACCMODE;
filp->f_flags = O_RDWR;
filp->f_inode = inode;
filp->f_pos = 0;
filp->f_reada = 0;
filp->f_op = inode->i_op->default_file_ops;
/*
** Chris Rankin - 15/02/98
** We require BOTH read() and write() functions
**
** if (filp->f_op->read || filp->f_op->write) {
*/
if (filp->f_op && filp->f_op->read && filp->f_op->write) {
/**/
if ((error = get_write_access(inode)) == 0) {
/*
** Chris Rankin - 15/02/98
** Moved NULL-pointer test up - it's too late here!
**
** if (filp->f_op && filp->f_op->open)
*/
if (filp->f_op->open)
/**/
error = filp->f_op->open(inode, filp);
if (error == 0) {
vfsmnt->mnt_quotas[type] = filp;

Cheers,
Chris.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu