cifs: handle lease F_UNLCK requests properly
Subsystems (2)
PATCH 1/1 cifs: handle lease F_UNLCK requests properly
Currently any F_UNLCK request for a lease just gets back -EAGAIN. Allow them to go immediately to generic_setlease instead.
--- fs/cifs/cifsfs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/cifs/cifsfs.c +3 -2
@@ -799,8 +799,9 @@ static int cifs_setlease(struct file *file, long arg, struct file_lock **lease)if (!(S_ISREG (inode->i_mode)))return -EINVAL ; -/* check if file is oplocked */ -if (((arg ==F_RDLCK ) &&CIFS_CACHE_READ (CIFS_I (inode))) || +/* Check if file is oplocked if this is request for new lease */ +if (arg ==F_UNLCK || + ((arg ==F_RDLCK ) &&CIFS_CACHE_READ (CIFS_I (inode))) || ((arg ==F_WRLCK ) &&CIFS_CACHE_WRITE (CIFS_I (inode))))return generic_setlease (file, arg, lease); else if (tlink_tcon(cfile->tlink)->local_lease &&
Signature · 1 line
1.9.3
A message that is not in the archive (sent off-list or not yet received): 1407593804-28053-1-git-send-email-jlayton-7I+n7zu2hftEKMMhf/[email protected]
Steve French
AppliedMerged into cifs-2.6.git
Did you find this with a test case or by inspection?
Quoted 27 lines · Jeff Layton
Currently any
F_UNLCKrequest for a lease just gets back-EAGAIN. Allow them to go immediately togeneric_setleaseinstead.--- fs/cifs/cifsfs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)fs/cifs/cifsfs.c +3
-3@@ -799,8 +799,9 @@ static int cifs_setlease(struct file *file, long arg, struct file_lock **lease)if (!(S_ISREG (inode->i_mode)))return -EINVAL ; -/* check if file is oplocked */ -if (((arg ==F_RDLCK ) &&CIFS_CACHE_READ (CIFS_I (inode))) || +/* Check if file is oplocked if this is request for new lease */ +if (arg ==F_UNLCK || + ((arg ==F_RDLCK ) &&CIFS_CACHE_READ (CIFS_I (inode))) || ((arg ==F_WRLCK ) &&CIFS_CACHE_WRITE (CIFS_I (inode))))return generic_setlease (file, arg, lease); else if (tlink_tcon(cfile->tlink)->local_lease && --1.9.3
Signature · 3 lines
Thanks, Steve