diff options
-rw-r--r-- | fs/namei.c | 5 | ||||
-rw-r--r-- | fs/open.c | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/fs/namei.c b/fs/namei.c index 9061157e39d6..7657be4352bf 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -2035,10 +2035,7 @@ static int may_open(struct path *path, int acc_mode, int flag) | |||
2035 | if (flag & O_NOATIME && !inode_owner_or_capable(inode)) | 2035 | if (flag & O_NOATIME && !inode_owner_or_capable(inode)) |
2036 | return -EPERM; | 2036 | return -EPERM; |
2037 | 2037 | ||
2038 | /* | 2038 | return 0; |
2039 | * Ensure there are no outstanding leases on the file. | ||
2040 | */ | ||
2041 | return break_lease(inode, flag); | ||
2042 | } | 2039 | } |
2043 | 2040 | ||
2044 | static int handle_truncate(struct file *filp) | 2041 | static int handle_truncate(struct file *filp) |
@@ -685,6 +685,10 @@ static struct file *__dentry_open(struct dentry *dentry, struct vfsmount *mnt, | |||
685 | if (error) | 685 | if (error) |
686 | goto cleanup_all; | 686 | goto cleanup_all; |
687 | 687 | ||
688 | error = break_lease(inode, f->f_flags); | ||
689 | if (error) | ||
690 | goto cleanup_all; | ||
691 | |||
688 | if (!open && f->f_op) | 692 | if (!open && f->f_op) |
689 | open = f->f_op->open; | 693 | open = f->f_op->open; |
690 | if (open) { | 694 | if (open) { |