.. | .. |
---|
62 | 62 | smb2_oplock = SMB2_OPLOCK_LEVEL_BATCH; |
---|
63 | 63 | |
---|
64 | 64 | rc = SMB2_open(xid, oparms, smb2_path, &smb2_oplock, smb2_data, NULL, |
---|
65 | | - NULL); |
---|
| 65 | + NULL, NULL); |
---|
66 | 66 | if (rc) |
---|
67 | 67 | goto out; |
---|
68 | 68 | |
---|
69 | 69 | |
---|
70 | 70 | if (oparms->tcon->use_resilient) { |
---|
71 | | - nr_ioctl_req.Timeout = 0; /* use server default (120 seconds) */ |
---|
| 71 | + /* default timeout is 0, servers pick default (120 seconds) */ |
---|
| 72 | + nr_ioctl_req.Timeout = |
---|
| 73 | + cpu_to_le32(oparms->tcon->handle_timeout); |
---|
72 | 74 | nr_ioctl_req.Reserved = 0; |
---|
73 | 75 | rc = SMB2_ioctl(xid, oparms->tcon, fid->persistent_fid, |
---|
74 | 76 | fid->volatile_fid, FSCTL_LMR_REQUEST_RESILIENCY, |
---|
75 | | - true /* is_fsctl */, |
---|
76 | 77 | (char *)&nr_ioctl_req, sizeof(nr_ioctl_req), |
---|
77 | | - NULL, NULL /* no return info */); |
---|
| 78 | + CIFSMaxBufSize, NULL, NULL /* no return info */); |
---|
78 | 79 | if (rc == -EOPNOTSUPP) { |
---|
79 | 80 | cifs_dbg(VFS, |
---|
80 | 81 | "resiliency not supported by server, disabling\n"); |
---|
.. | .. |
---|
86 | 87 | } |
---|
87 | 88 | |
---|
88 | 89 | if (buf) { |
---|
89 | | - /* open response does not have IndexNumber field - get it */ |
---|
90 | | - rc = SMB2_get_srv_num(xid, oparms->tcon, fid->persistent_fid, |
---|
| 90 | + /* if open response does not have IndexNumber field - get it */ |
---|
| 91 | + if (smb2_data->IndexNumber == 0) { |
---|
| 92 | + rc = SMB2_get_srv_num(xid, oparms->tcon, |
---|
| 93 | + fid->persistent_fid, |
---|
91 | 94 | fid->volatile_fid, |
---|
92 | 95 | &smb2_data->IndexNumber); |
---|
93 | | - if (rc) { |
---|
94 | | - /* let get_inode_info disable server inode numbers */ |
---|
95 | | - smb2_data->IndexNumber = 0; |
---|
96 | | - rc = 0; |
---|
| 96 | + if (rc) { |
---|
| 97 | + /* |
---|
| 98 | + * let get_inode_info disable server inode |
---|
| 99 | + * numbers |
---|
| 100 | + */ |
---|
| 101 | + smb2_data->IndexNumber = 0; |
---|
| 102 | + rc = 0; |
---|
| 103 | + } |
---|
97 | 104 | } |
---|
98 | 105 | move_smb2_info_to_cifs(buf, smb2_data); |
---|
99 | 106 | } |
---|
.. | .. |
---|
144 | 151 | (li->offset + li->length)) |
---|
145 | 152 | continue; |
---|
146 | 153 | if (current->tgid != li->pid) |
---|
147 | | - continue; |
---|
| 154 | + /* |
---|
| 155 | + * flock and OFD lock are associated with an open |
---|
| 156 | + * file description, not the process. |
---|
| 157 | + */ |
---|
| 158 | + if (!(flock->fl_flags & (FL_FLOCK | FL_OFDLCK))) |
---|
| 159 | + continue; |
---|
148 | 160 | if (cinode->can_cache_brlcks) { |
---|
149 | 161 | /* |
---|
150 | 162 | * We can cache brlock requests - simply remove a lock |
---|