On Fri, May 09, 2014 at 12:21:29PM -0400, Jeff Layton wrote: > - /* Ensure that fl->fl_filp has compatible f_mode */ > - switch (l->l_type) { > - case F_RDLCK: > - if (!(filp->f_mode & FMODE_READ)) > - return -EBADF; > - break; > - case F_WRLCK: > - if (!(filp->f_mode & FMODE_WRITE)) > - return -EBADF; > - break; > - } > +check_fmode_for_setlk(struct file_lock *fl) > +{ > + switch (fl->fl_type) { > + case F_RDLCK: > + if (!(fl->fl_file->f_mode & FMODE_READ)) > + return -EBADF; > + case F_WRLCK: > + if (!(fl->fl_file->f_mode & FMODE_WRITE)) > + return -EBADF; > + } > + return 0; > +} Why are we now checking FMODE_WRITE for the RDLCK case ? Or was losing the break; unintentional ? Dave -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html