Loading fs/locks.c +10 −20 Original line number Diff line number Diff line Loading @@ -1343,6 +1343,14 @@ static int __setlease(struct file *filp, long arg, struct file_lock **flp) struct inode *inode = dentry->d_inode; int error, rdlease_count = 0, wrlease_count = 0; if ((current->fsuid != inode->i_uid) && !capable(CAP_LEASE)) return -EACCES; if (!S_ISREG(inode->i_mode)) return -EINVAL; error = security_file_lock(filp, arg); if (error) return error; time_out_leases(inode); BUG_ON(!(*flp)->fl_lmops->fl_break); Loading Loading @@ -1426,18 +1434,8 @@ static int __setlease(struct file *filp, long arg, struct file_lock **flp) int setlease(struct file *filp, long arg, struct file_lock **lease) { struct dentry *dentry = filp->f_path.dentry; struct inode *inode = dentry->d_inode; int error; if ((current->fsuid != inode->i_uid) && !capable(CAP_LEASE)) return -EACCES; if (!S_ISREG(inode->i_mode)) return -EINVAL; error = security_file_lock(filp, arg); if (error) return error; lock_kernel(); error = __setlease(filp, arg, lease); unlock_kernel(); Loading @@ -1464,14 +1462,6 @@ int fcntl_setlease(unsigned int fd, struct file *filp, long arg) struct inode *inode = dentry->d_inode; int error; if ((current->fsuid != inode->i_uid) && !capable(CAP_LEASE)) return -EACCES; if (!S_ISREG(inode->i_mode)) return -EINVAL; error = security_file_lock(filp, arg); if (error) return error; locks_init_lock(&fl); error = lease_init(filp, arg, &fl); if (error) Loading @@ -1485,7 +1475,7 @@ int fcntl_setlease(unsigned int fd, struct file *filp, long arg) error = fasync_helper(fd, filp, 1, &flp->fl_fasync); if (error < 0) { /* remove lease just inserted by __setlease */ /* remove lease just inserted by setlease */ flp->fl_type = F_UNLCK | F_INPROGRESS; flp->fl_break_time = jiffies - 10; time_out_leases(inode); Loading Loading
fs/locks.c +10 −20 Original line number Diff line number Diff line Loading @@ -1343,6 +1343,14 @@ static int __setlease(struct file *filp, long arg, struct file_lock **flp) struct inode *inode = dentry->d_inode; int error, rdlease_count = 0, wrlease_count = 0; if ((current->fsuid != inode->i_uid) && !capable(CAP_LEASE)) return -EACCES; if (!S_ISREG(inode->i_mode)) return -EINVAL; error = security_file_lock(filp, arg); if (error) return error; time_out_leases(inode); BUG_ON(!(*flp)->fl_lmops->fl_break); Loading Loading @@ -1426,18 +1434,8 @@ static int __setlease(struct file *filp, long arg, struct file_lock **flp) int setlease(struct file *filp, long arg, struct file_lock **lease) { struct dentry *dentry = filp->f_path.dentry; struct inode *inode = dentry->d_inode; int error; if ((current->fsuid != inode->i_uid) && !capable(CAP_LEASE)) return -EACCES; if (!S_ISREG(inode->i_mode)) return -EINVAL; error = security_file_lock(filp, arg); if (error) return error; lock_kernel(); error = __setlease(filp, arg, lease); unlock_kernel(); Loading @@ -1464,14 +1462,6 @@ int fcntl_setlease(unsigned int fd, struct file *filp, long arg) struct inode *inode = dentry->d_inode; int error; if ((current->fsuid != inode->i_uid) && !capable(CAP_LEASE)) return -EACCES; if (!S_ISREG(inode->i_mode)) return -EINVAL; error = security_file_lock(filp, arg); if (error) return error; locks_init_lock(&fl); error = lease_init(filp, arg, &fl); if (error) Loading @@ -1485,7 +1475,7 @@ int fcntl_setlease(unsigned int fd, struct file *filp, long arg) error = fasync_helper(fd, filp, 1, &flp->fl_fasync); if (error < 0) { /* remove lease just inserted by __setlease */ /* remove lease just inserted by setlease */ flp->fl_type = F_UNLCK | F_INPROGRESS; flp->fl_break_time = jiffies - 10; time_out_leases(inode); Loading