Allow block special files to be file locked
This commit is contained in:
parent
63a49a4b90
commit
55d926cbaa
1 changed files with 2 additions and 1 deletions
|
@ -43,7 +43,8 @@ int req; /* either F_SETLK or F_SETLKW */
|
|||
mo = f->filp_mode;
|
||||
if (ltype != F_UNLCK && ltype != F_RDLCK && ltype != F_WRLCK) return(EINVAL);
|
||||
if (req == F_GETLK && ltype == F_UNLCK) return(EINVAL);
|
||||
if ( (f->filp_vno->v_mode & I_TYPE) != I_REGULAR) return(EINVAL);
|
||||
if ( (f->filp_vno->v_mode & I_TYPE) != I_REGULAR &&
|
||||
(f->filp_vno->v_mode & I_TYPE) != I_BLOCK_SPECIAL) return(EINVAL);
|
||||
if (req != F_GETLK && ltype == F_RDLCK && (mo & R_BIT) == 0) return(EBADF);
|
||||
if (req != F_GETLK && ltype == F_WRLCK && (mo & W_BIT) == 0) return(EBADF);
|
||||
|
||||
|
|
Loading…
Reference in a new issue