Commit 45a64e8b authored by Hyunchul Lee's avatar Hyunchul Lee Committed by Namjae Jeon

ksmbd: uninterruptible wait for a file being unlocked

the wait can be canceled by SMB2_CANCEL, SMB2_CLOSE,
SMB2_LOGOFF, disconnection or shutdown, we don't have
to use wait_event_interruptible.

And this remove the warning from Coverity:

CID 1502834 (#1 of 1): Unused value (UNUSED_VALUE)
returned_value: Assigning value from ksmbd_vfs_posix_lock_wait(flock)
to err here, but that stored value is overwritten before it can be used.
Signed-off-by: default avatarHyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: default avatarNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent d63528eb
...@@ -6799,7 +6799,7 @@ int smb2_lock(struct ksmbd_work *work) ...@@ -6799,7 +6799,7 @@ int smb2_lock(struct ksmbd_work *work)
smb2_send_interim_resp(work, STATUS_PENDING); smb2_send_interim_resp(work, STATUS_PENDING);
err = ksmbd_vfs_posix_lock_wait(flock); ksmbd_vfs_posix_lock_wait(flock);
if (work->state != KSMBD_WORK_ACTIVE) { if (work->state != KSMBD_WORK_ACTIVE) {
list_del(&smb_lock->llist); list_del(&smb_lock->llist);
......
...@@ -1784,9 +1784,9 @@ int ksmbd_vfs_copy_file_ranges(struct ksmbd_work *work, ...@@ -1784,9 +1784,9 @@ int ksmbd_vfs_copy_file_ranges(struct ksmbd_work *work,
return 0; return 0;
} }
int ksmbd_vfs_posix_lock_wait(struct file_lock *flock) void ksmbd_vfs_posix_lock_wait(struct file_lock *flock)
{ {
return wait_event_interruptible(flock->fl_wait, !flock->fl_blocker); wait_event(flock->fl_wait, !flock->fl_blocker);
} }
int ksmbd_vfs_posix_lock_wait_timeout(struct file_lock *flock, long timeout) int ksmbd_vfs_posix_lock_wait_timeout(struct file_lock *flock, long timeout)
......
...@@ -168,7 +168,7 @@ int ksmbd_vfs_fill_dentry_attrs(struct ksmbd_work *work, ...@@ -168,7 +168,7 @@ int ksmbd_vfs_fill_dentry_attrs(struct ksmbd_work *work,
struct user_namespace *user_ns, struct user_namespace *user_ns,
struct dentry *dentry, struct dentry *dentry,
struct ksmbd_kstat *ksmbd_kstat); struct ksmbd_kstat *ksmbd_kstat);
int ksmbd_vfs_posix_lock_wait(struct file_lock *flock); void ksmbd_vfs_posix_lock_wait(struct file_lock *flock);
int ksmbd_vfs_posix_lock_wait_timeout(struct file_lock *flock, long timeout); int ksmbd_vfs_posix_lock_wait_timeout(struct file_lock *flock, long timeout);
void ksmbd_vfs_posix_lock_unblock(struct file_lock *flock); void ksmbd_vfs_posix_lock_unblock(struct file_lock *flock);
int ksmbd_vfs_remove_acl_xattrs(struct user_namespace *user_ns, int ksmbd_vfs_remove_acl_xattrs(struct user_namespace *user_ns,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment