summaryrefslogtreecommitdiff
path: root/fs/ksmbd/oplock.c
diff options
context:
space:
mode:
authorNamjae Jeon <namjae.jeon@samsung.com>2021-06-29 03:24:31 +0300
committerNamjae Jeon <namjae.jeon@samsung.com>2021-06-29 09:07:56 +0300
commit849fbc549d4cca576d659d7df139c5f04104cb48 (patch)
treec08ec3ed07c893b77054e952a5b811755b4d2f95 /fs/ksmbd/oplock.c
parent12202c0594b18218e1645fd0fad92cf77a1f3145 (diff)
downloadlinux-849fbc549d4cca576d659d7df139c5f04104cb48.tar.xz
ksmbd: opencode to remove ATTR_FP macro
Opencode to remove ATTR_FP macro. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/ksmbd/oplock.c')
-rw-r--r--fs/ksmbd/oplock.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ksmbd/oplock.c b/fs/ksmbd/oplock.c
index 3f0dd9b35c78..43c8b7ce6095 100644
--- a/fs/ksmbd/oplock.c
+++ b/fs/ksmbd/oplock.c
@@ -1111,7 +1111,9 @@ int smb_grant_oplock(struct ksmbd_work *work, int req_op_level, u64 pid,
goto set_lev;
/* grant none-oplock if second open is trunc */
- if (ATTR_FP(fp)) {
+ if (fp->attrib_only && fp->cdoption != FILE_OVERWRITE_IF_LE &&
+ fp->cdoption != FILE_OVERWRITE_LE &&
+ fp->cdoption != FILE_SUPERSEDE_LE) {
req_op_level = SMB2_OPLOCK_LEVEL_NONE;
goto set_lev;
}