Skip to content

Commit 40e75e4

Browse files
pcacjrsmfrench
authored andcommitted
smb: client: fix open handle lookup in cifs_open()
When looking up open handles to be re-used in cifs_open(), calling cifs_get_{writable,readable}_path() is wrong as it will look up for the first matching open handle, and if @file->f_flags doesn't match, it will ignore the remaining open handles in cifsInodeInfo::openFileList that might potentially match @file->f_flags. For writable and readable handles, fix this by calling __cifs_get_writable_file() and __find_readable_file(), respectively, with FIND_OPEN_FLAGS set. With the patch, the following program ends up with two opens instead of three sent over the wire. ``` #define _GNU_SOURCE #include <unistd.h> #include <string.h> #include <fcntl.h> int main(int argc, char *argv[]) { int fd; fd = open("/mnt/1/foo", O_CREAT | O_WRONLY | O_TRUNC, 0664); close(fd); fd = open("/mnt/1/foo", O_DIRECT | O_WRONLY); close(fd); fd = open("/mnt/1/foo", O_WRONLY); close(fd); fd = open("/mnt/1/foo", O_DIRECT | O_WRONLY); close(fd); return 0; } ``` ``` $ mount.cifs //srv/share /mnt/1 -o ... $ gcc test.c && ./a.out ``` Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.org> Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Cc: David Howells <dhowells@redhat.com> Cc: linux-cifs@vger.kernel.org Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent d4c7210 commit 40e75e4

9 files changed

Lines changed: 113 additions & 76 deletions

File tree

fs/smb/client/cifsacl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1489,7 +1489,7 @@ struct smb_ntsd *get_cifs_acl(struct cifs_sb_info *cifs_sb,
14891489
struct cifsFileInfo *open_file = NULL;
14901490

14911491
if (inode)
1492-
open_file = find_readable_file(CIFS_I(inode), true);
1492+
open_file = find_readable_file(CIFS_I(inode), FIND_FSUID_ONLY);
14931493
if (!open_file)
14941494
return get_cifs_acl_by_path(cifs_sb, path, pacllen, info);
14951495

fs/smb/client/cifsfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,7 @@ static int cifs_precopy_set_eof(struct inode *src_inode, struct cifsInodeInfo *s
12691269
struct cifsFileInfo *writeable_srcfile;
12701270
int rc = -EINVAL;
12711271

1272-
writeable_srcfile = find_writable_file(src_cifsi, FIND_WR_FSUID_ONLY);
1272+
writeable_srcfile = find_writable_file(src_cifsi, FIND_FSUID_ONLY);
12731273
if (writeable_srcfile) {
12741274
if (src_tcon->ses->server->ops->set_file_size)
12751275
rc = src_tcon->ses->server->ops->set_file_size(

fs/smb/client/cifsglob.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1885,12 +1885,12 @@ static inline bool is_replayable_error(int error)
18851885
}
18861886

18871887

1888-
/* cifs_get_writable_file() flags */
1889-
enum cifs_writable_file_flags {
1890-
FIND_WR_ANY = 0U,
1891-
FIND_WR_FSUID_ONLY = (1U << 0),
1892-
FIND_WR_WITH_DELETE = (1U << 1),
1893-
FIND_WR_NO_PENDING_DELETE = (1U << 2),
1888+
enum cifs_find_flags {
1889+
FIND_ANY = 0U,
1890+
FIND_FSUID_ONLY = (1U << 0),
1891+
FIND_WITH_DELETE = (1U << 1),
1892+
FIND_NO_PENDING_DELETE = (1U << 2),
1893+
FIND_OPEN_FLAGS = (1U << 3),
18941894
};
18951895

18961896
#define MID_FREE 0

fs/smb/client/cifsproto.h

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,14 @@ void cifs_write_subrequest_terminated(struct cifs_io_subrequest *wdata,
138138
ssize_t result);
139139
struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode,
140140
int flags);
141-
int cifs_get_writable_file(struct cifsInodeInfo *cifs_inode, int flags,
142-
struct cifsFileInfo **ret_file);
141+
int __cifs_get_writable_file(struct cifsInodeInfo *cifs_inode,
142+
unsigned int find_flags, unsigned int open_flags,
143+
struct cifsFileInfo **ret_file);
143144
int cifs_get_writable_path(struct cifs_tcon *tcon, const char *name, int flags,
144145
struct cifsFileInfo **ret_file);
145-
struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode,
146-
bool fsuid_only);
146+
struct cifsFileInfo *__find_readable_file(struct cifsInodeInfo *cifs_inode,
147+
unsigned int find_flags,
148+
unsigned int open_flags);
147149
int cifs_get_readable_path(struct cifs_tcon *tcon, const char *name,
148150
struct cifsFileInfo **ret_file);
149151
int cifs_get_hardlink_path(struct cifs_tcon *tcon, struct inode *inode,
@@ -596,4 +598,20 @@ static inline void cifs_sg_set_buf(struct sg_table *sgtable,
596598
}
597599
}
598600

601+
static inline int cifs_get_writable_file(struct cifsInodeInfo *cifs_inode,
602+
unsigned int find_flags,
603+
struct cifsFileInfo **ret_file)
604+
{
605+
find_flags &= ~FIND_OPEN_FLAGS;
606+
return __cifs_get_writable_file(cifs_inode, find_flags, 0, ret_file);
607+
}
608+
609+
static inline struct cifsFileInfo *
610+
find_readable_file(struct cifsInodeInfo *cinode, unsigned int find_flags)
611+
{
612+
find_flags &= ~FIND_OPEN_FLAGS;
613+
find_flags |= FIND_NO_PENDING_DELETE;
614+
return __find_readable_file(cinode, find_flags, 0);
615+
}
616+
599617
#endif /* _CIFSPROTO_H */

fs/smb/client/file.c

Lines changed: 67 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ static void cifs_begin_writeback(struct netfs_io_request *wreq)
255255
struct cifs_io_request *req = container_of(wreq, struct cifs_io_request, rreq);
256256
int ret;
257257

258-
ret = cifs_get_writable_file(CIFS_I(wreq->inode), FIND_WR_ANY, &req->cfile);
258+
ret = cifs_get_writable_file(CIFS_I(wreq->inode), FIND_ANY, &req->cfile);
259259
if (ret) {
260260
cifs_dbg(VFS, "No writable handle in writepages ret=%d\n", ret);
261261
return;
@@ -956,7 +956,7 @@ int cifs_file_flush(const unsigned int xid, struct inode *inode,
956956
return tcon->ses->server->ops->flush(xid, tcon,
957957
&cfile->fid);
958958
}
959-
rc = cifs_get_writable_file(CIFS_I(inode), FIND_WR_ANY, &cfile);
959+
rc = cifs_get_writable_file(CIFS_I(inode), FIND_ANY, &cfile);
960960
if (!rc) {
961961
tcon = tlink_tcon(cfile->tlink);
962962
rc = tcon->ses->server->ops->flush(xid, tcon, &cfile->fid);
@@ -981,7 +981,7 @@ static int cifs_do_truncate(const unsigned int xid, struct dentry *dentry)
981981
return -ERESTARTSYS;
982982
mapping_set_error(inode->i_mapping, rc);
983983

984-
cfile = find_writable_file(cinode, FIND_WR_FSUID_ONLY);
984+
cfile = find_writable_file(cinode, FIND_FSUID_ONLY);
985985
rc = cifs_file_flush(xid, inode, cfile);
986986
if (!rc) {
987987
if (cfile) {
@@ -1061,32 +1061,29 @@ int cifs_open(struct inode *inode, struct file *file)
10611061

10621062
/* Get the cached handle as SMB2 close is deferred */
10631063
if (OPEN_FMODE(file->f_flags) & FMODE_WRITE) {
1064-
rc = cifs_get_writable_path(tcon, full_path,
1065-
FIND_WR_FSUID_ONLY |
1066-
FIND_WR_NO_PENDING_DELETE,
1067-
&cfile);
1064+
rc = __cifs_get_writable_file(CIFS_I(inode),
1065+
FIND_FSUID_ONLY |
1066+
FIND_NO_PENDING_DELETE |
1067+
FIND_OPEN_FLAGS,
1068+
file->f_flags, &cfile);
10681069
} else {
1069-
rc = cifs_get_readable_path(tcon, full_path, &cfile);
1070+
cfile = __find_readable_file(CIFS_I(inode),
1071+
FIND_NO_PENDING_DELETE |
1072+
FIND_OPEN_FLAGS,
1073+
file->f_flags);
1074+
rc = cfile ? 0 : -ENOENT;
10701075
}
10711076
if (rc == 0) {
1072-
unsigned int oflags = file->f_flags & ~(O_CREAT|O_EXCL|O_TRUNC);
1073-
unsigned int cflags = cfile->f_flags & ~(O_CREAT|O_EXCL|O_TRUNC);
1074-
1075-
if (cifs_convert_flags(oflags, 0) == cifs_convert_flags(cflags, 0) &&
1076-
(oflags & (O_SYNC|O_DIRECT)) == (cflags & (O_SYNC|O_DIRECT))) {
1077-
file->private_data = cfile;
1078-
spin_lock(&CIFS_I(inode)->deferred_lock);
1079-
cifs_del_deferred_close(cfile);
1080-
spin_unlock(&CIFS_I(inode)->deferred_lock);
1081-
goto use_cache;
1082-
}
1083-
_cifsFileInfo_put(cfile, true, false);
1084-
} else {
1085-
/* hard link on the defeered close file */
1086-
rc = cifs_get_hardlink_path(tcon, inode, file);
1087-
if (rc)
1088-
cifs_close_deferred_file(CIFS_I(inode));
1089-
}
1077+
file->private_data = cfile;
1078+
spin_lock(&CIFS_I(inode)->deferred_lock);
1079+
cifs_del_deferred_close(cfile);
1080+
spin_unlock(&CIFS_I(inode)->deferred_lock);
1081+
goto use_cache;
1082+
}
1083+
/* hard link on the deferred close file */
1084+
rc = cifs_get_hardlink_path(tcon, inode, file);
1085+
if (rc)
1086+
cifs_close_deferred_file(CIFS_I(inode));
10901087

10911088
if (server->oplocks)
10921089
oplock = REQ_OPLOCK;
@@ -2512,10 +2509,33 @@ void cifs_write_subrequest_terminated(struct cifs_io_subrequest *wdata, ssize_t
25122509
netfs_write_subrequest_terminated(&wdata->subreq, result);
25132510
}
25142511

2515-
struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode,
2516-
bool fsuid_only)
2512+
static bool open_flags_match(struct cifsInodeInfo *cinode,
2513+
unsigned int oflags, unsigned int cflags)
2514+
{
2515+
struct inode *inode = &cinode->netfs.inode;
2516+
int crw = 0, orw = 0;
2517+
2518+
oflags &= ~(O_CREAT | O_EXCL | O_TRUNC);
2519+
cflags &= ~(O_CREAT | O_EXCL | O_TRUNC);
2520+
2521+
if (cifs_fscache_enabled(inode)) {
2522+
if (OPEN_FMODE(cflags) & FMODE_WRITE)
2523+
crw = 1;
2524+
if (OPEN_FMODE(oflags) & FMODE_WRITE)
2525+
orw = 1;
2526+
}
2527+
if (cifs_convert_flags(oflags, orw) != cifs_convert_flags(cflags, crw))
2528+
return false;
2529+
2530+
return (oflags & (O_SYNC | O_DIRECT)) == (cflags & (O_SYNC | O_DIRECT));
2531+
}
2532+
2533+
struct cifsFileInfo *__find_readable_file(struct cifsInodeInfo *cifs_inode,
2534+
unsigned int find_flags,
2535+
unsigned int open_flags)
25172536
{
25182537
struct cifs_sb_info *cifs_sb = CIFS_SB(cifs_inode);
2538+
bool fsuid_only = find_flags & FIND_FSUID_ONLY;
25192539
struct cifsFileInfo *open_file = NULL;
25202540

25212541
/* only filter by fsuid on multiuser mounts */
@@ -2529,6 +2549,13 @@ struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode,
25292549
list_for_each_entry(open_file, &cifs_inode->openFileList, flist) {
25302550
if (fsuid_only && !uid_eq(open_file->uid, current_fsuid()))
25312551
continue;
2552+
if ((find_flags & FIND_NO_PENDING_DELETE) &&
2553+
open_file->status_file_deleted)
2554+
continue;
2555+
if ((find_flags & FIND_OPEN_FLAGS) &&
2556+
!open_flags_match(cifs_inode, open_flags,
2557+
open_file->f_flags))
2558+
continue;
25322559
if (OPEN_FMODE(open_file->f_flags) & FMODE_READ) {
25332560
if ((!open_file->invalidHandle)) {
25342561
/* found a good file */
@@ -2547,17 +2574,17 @@ struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode,
25472574
}
25482575

25492576
/* Return -EBADF if no handle is found and general rc otherwise */
2550-
int
2551-
cifs_get_writable_file(struct cifsInodeInfo *cifs_inode, int flags,
2552-
struct cifsFileInfo **ret_file)
2577+
int __cifs_get_writable_file(struct cifsInodeInfo *cifs_inode,
2578+
unsigned int find_flags, unsigned int open_flags,
2579+
struct cifsFileInfo **ret_file)
25532580
{
25542581
struct cifsFileInfo *open_file, *inv_file = NULL;
25552582
struct cifs_sb_info *cifs_sb;
25562583
bool any_available = false;
25572584
int rc = -EBADF;
25582585
unsigned int refind = 0;
2559-
bool fsuid_only = flags & FIND_WR_FSUID_ONLY;
2560-
bool with_delete = flags & FIND_WR_WITH_DELETE;
2586+
bool fsuid_only = find_flags & FIND_FSUID_ONLY;
2587+
bool with_delete = find_flags & FIND_WITH_DELETE;
25612588
*ret_file = NULL;
25622589

25632590
/*
@@ -2591,9 +2618,13 @@ cifs_get_writable_file(struct cifsInodeInfo *cifs_inode, int flags,
25912618
continue;
25922619
if (with_delete && !(open_file->fid.access & DELETE))
25932620
continue;
2594-
if ((flags & FIND_WR_NO_PENDING_DELETE) &&
2621+
if ((find_flags & FIND_NO_PENDING_DELETE) &&
25952622
open_file->status_file_deleted)
25962623
continue;
2624+
if ((find_flags & FIND_OPEN_FLAGS) &&
2625+
!open_flags_match(cifs_inode, open_flags,
2626+
open_file->f_flags))
2627+
continue;
25972628
if (OPEN_FMODE(open_file->f_flags) & FMODE_WRITE) {
25982629
if (!open_file->invalidHandle) {
25992630
/* found a good writable file */
@@ -2710,17 +2741,7 @@ cifs_get_readable_path(struct cifs_tcon *tcon, const char *name,
27102741
cinode = CIFS_I(d_inode(cfile->dentry));
27112742
spin_unlock(&tcon->open_file_lock);
27122743
free_dentry_path(page);
2713-
*ret_file = find_readable_file(cinode, 0);
2714-
if (*ret_file) {
2715-
spin_lock(&cinode->open_file_lock);
2716-
if ((*ret_file)->status_file_deleted) {
2717-
spin_unlock(&cinode->open_file_lock);
2718-
cifsFileInfo_put(*ret_file);
2719-
*ret_file = NULL;
2720-
} else {
2721-
spin_unlock(&cinode->open_file_lock);
2722-
}
2723-
}
2744+
*ret_file = find_readable_file(cinode, FIND_ANY);
27242745
return *ret_file ? 0 : -ENOENT;
27252746
}
27262747

@@ -2792,7 +2813,7 @@ int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
27922813
}
27932814

27942815
if ((OPEN_FMODE(smbfile->f_flags) & FMODE_WRITE) == 0) {
2795-
smbfile = find_writable_file(CIFS_I(inode), FIND_WR_ANY);
2816+
smbfile = find_writable_file(CIFS_I(inode), FIND_ANY);
27962817
if (smbfile) {
27972818
rc = server->ops->flush(xid, tcon, &smbfile->fid);
27982819
cifsFileInfo_put(smbfile);

fs/smb/client/inode.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2997,7 +2997,7 @@ int cifs_fiemap(struct inode *inode, struct fiemap_extent_info *fei, u64 start,
29972997
}
29982998
}
29992999

3000-
cfile = find_readable_file(cifs_i, false);
3000+
cfile = find_readable_file(cifs_i, FIND_ANY);
30013001
if (cfile == NULL)
30023002
return -EINVAL;
30033003

@@ -3050,7 +3050,7 @@ int cifs_file_set_size(const unsigned int xid, struct dentry *dentry,
30503050
size, false);
30513051
cifs_dbg(FYI, "%s: set_file_size: rc = %d\n", __func__, rc);
30523052
} else {
3053-
open_file = find_writable_file(cifsInode, FIND_WR_FSUID_ONLY);
3053+
open_file = find_writable_file(cifsInode, FIND_FSUID_ONLY);
30543054
if (open_file) {
30553055
tcon = tlink_tcon(open_file->tlink);
30563056
server = tcon->ses->server;
@@ -3219,7 +3219,7 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs)
32193219
open_file->fid.netfid,
32203220
open_file->pid);
32213221
} else {
3222-
open_file = find_writable_file(cifsInode, FIND_WR_FSUID_ONLY);
3222+
open_file = find_writable_file(cifsInode, FIND_FSUID_ONLY);
32233223
if (open_file) {
32243224
pTcon = tlink_tcon(open_file->tlink);
32253225
rc = CIFSSMBUnixSetFileInfo(xid, pTcon, args,

fs/smb/client/smb1ops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ smb_set_file_info(struct inode *inode, const char *full_path,
960960
struct cifs_tcon *tcon;
961961

962962
/* if the file is already open for write, just use that fileid */
963-
open_file = find_writable_file(cinode, FIND_WR_FSUID_ONLY);
963+
open_file = find_writable_file(cinode, FIND_FSUID_ONLY);
964964

965965
if (open_file) {
966966
fid.netfid = open_file->fid.netfid;

fs/smb/client/smb2inode.c

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,7 @@ smb2_mkdir_setinfo(struct inode *inode, const char *name,
11561156
cifs_i = CIFS_I(inode);
11571157
dosattrs = cifs_i->cifsAttrs | ATTR_READONLY;
11581158
data.Attributes = cpu_to_le32(dosattrs);
1159-
cifs_get_writable_path(tcon, name, FIND_WR_ANY, &cfile);
1159+
cifs_get_writable_path(tcon, name, FIND_ANY, &cfile);
11601160
oparms = CIFS_OPARMS(cifs_sb, tcon, name, FILE_WRITE_ATTRIBUTES,
11611161
FILE_CREATE, CREATE_NOT_FILE, ACL_NO_MODE);
11621162
tmprc = smb2_compound_op(xid, tcon, cifs_sb, name,
@@ -1336,14 +1336,13 @@ int smb2_rename_path(const unsigned int xid,
13361336
__u32 co = file_create_options(source_dentry);
13371337

13381338
drop_cached_dir_by_name(xid, tcon, from_name, cifs_sb);
1339-
cifs_get_writable_path(tcon, from_name, FIND_WR_WITH_DELETE, &cfile);
1339+
cifs_get_writable_path(tcon, from_name, FIND_WITH_DELETE, &cfile);
13401340

13411341
int rc = smb2_set_path_attr(xid, tcon, from_name, to_name, cifs_sb,
13421342
co, DELETE, SMB2_OP_RENAME, cfile, source_dentry);
13431343
if (rc == -EINVAL) {
13441344
cifs_dbg(FYI, "invalid lease key, resending request without lease");
1345-
cifs_get_writable_path(tcon, from_name,
1346-
FIND_WR_WITH_DELETE, &cfile);
1345+
cifs_get_writable_path(tcon, from_name, FIND_WITH_DELETE, &cfile);
13471346
rc = smb2_set_path_attr(xid, tcon, from_name, to_name, cifs_sb,
13481347
co, DELETE, SMB2_OP_RENAME, cfile, NULL);
13491348
}
@@ -1377,7 +1376,7 @@ smb2_set_path_size(const unsigned int xid, struct cifs_tcon *tcon,
13771376

13781377
in_iov.iov_base = &eof;
13791378
in_iov.iov_len = sizeof(eof);
1380-
cifs_get_writable_path(tcon, full_path, FIND_WR_ANY, &cfile);
1379+
cifs_get_writable_path(tcon, full_path, FIND_ANY, &cfile);
13811380

13821381
oparms = CIFS_OPARMS(cifs_sb, tcon, full_path, FILE_WRITE_DATA,
13831382
FILE_OPEN, 0, ACL_NO_MODE);
@@ -1387,7 +1386,7 @@ smb2_set_path_size(const unsigned int xid, struct cifs_tcon *tcon,
13871386
cfile, NULL, NULL, dentry);
13881387
if (rc == -EINVAL) {
13891388
cifs_dbg(FYI, "invalid lease key, resending request without lease");
1390-
cifs_get_writable_path(tcon, full_path, FIND_WR_ANY, &cfile);
1389+
cifs_get_writable_path(tcon, full_path, FIND_ANY, &cfile);
13911390
rc = smb2_compound_op(xid, tcon, cifs_sb,
13921391
full_path, &oparms, &in_iov,
13931392
&(int){SMB2_OP_SET_EOF}, 1,
@@ -1417,7 +1416,7 @@ smb2_set_file_info(struct inode *inode, const char *full_path,
14171416
(buf->LastWriteTime == 0) && (buf->ChangeTime == 0)) {
14181417
if (buf->Attributes == 0)
14191418
goto out; /* would be a no op, no sense sending this */
1420-
cifs_get_writable_path(tcon, full_path, FIND_WR_ANY, &cfile);
1419+
cifs_get_writable_path(tcon, full_path, FIND_ANY, &cfile);
14211420
}
14221421

14231422
oparms = CIFS_OPARMS(cifs_sb, tcon, full_path, FILE_WRITE_ATTRIBUTES,
@@ -1476,7 +1475,7 @@ struct inode *smb2_create_reparse_inode(struct cifs_open_info_data *data,
14761475

14771476
if (tcon->posix_extensions) {
14781477
cmds[1] = SMB2_OP_POSIX_QUERY_INFO;
1479-
cifs_get_writable_path(tcon, full_path, FIND_WR_ANY, &cfile);
1478+
cifs_get_writable_path(tcon, full_path, FIND_ANY, &cfile);
14801479
rc = smb2_compound_op(xid, tcon, cifs_sb, full_path, &oparms,
14811480
in_iov, cmds, 2, cfile, out_iov, out_buftype, NULL);
14821481
if (!rc) {
@@ -1485,7 +1484,7 @@ struct inode *smb2_create_reparse_inode(struct cifs_open_info_data *data,
14851484
}
14861485
} else {
14871486
cmds[1] = SMB2_OP_QUERY_INFO;
1488-
cifs_get_writable_path(tcon, full_path, FIND_WR_ANY, &cfile);
1487+
cifs_get_writable_path(tcon, full_path, FIND_ANY, &cfile);
14891488
rc = smb2_compound_op(xid, tcon, cifs_sb, full_path, &oparms,
14901489
in_iov, cmds, 2, cfile, out_iov, out_buftype, NULL);
14911490
if (!rc) {
@@ -1636,13 +1635,12 @@ int smb2_rename_pending_delete(const char *full_path,
16361635
iov[1].iov_base = utf16_path;
16371636
iov[1].iov_len = sizeof(*utf16_path) * UniStrlen((wchar_t *)utf16_path);
16381637

1639-
cifs_get_writable_path(tcon, full_path, FIND_WR_WITH_DELETE, &cfile);
1638+
cifs_get_writable_path(tcon, full_path, FIND_WITH_DELETE, &cfile);
16401639
rc = smb2_compound_op(xid, tcon, cifs_sb, full_path, &oparms, iov,
16411640
cmds, num_cmds, cfile, NULL, NULL, dentry);
16421641
if (rc == -EINVAL) {
16431642
cifs_dbg(FYI, "invalid lease key, resending request without lease\n");
1644-
cifs_get_writable_path(tcon, full_path,
1645-
FIND_WR_WITH_DELETE, &cfile);
1643+
cifs_get_writable_path(tcon, full_path, FIND_WITH_DELETE, &cfile);
16461644
rc = smb2_compound_op(xid, tcon, cifs_sb, full_path, &oparms, iov,
16471645
cmds, num_cmds, cfile, NULL, NULL, NULL);
16481646
}

0 commit comments

Comments
 (0)