Commit e5e9b24
nfsd: freeze c/mtime updates with outstanding WRITE_ATTRS delegation
Instead of allowing the ctime to roll backward with a WRITE_ATTRS
delegation, set FMODE_NOCMTIME on the file and have it skip mtime and
ctime updates.
It is possible that the client will never send a SETATTR to set the
times before returning the delegation. Add two new bools to struct
nfs4_delegation:
dl_written: tracks whether the file has been written since the
delegation was granted. This is set in the WRITE and LAYOUTCOMMIT
handlers.
dl_setattr: tracks whether the client has sent at least one valid
mtime that can also update the ctime in a SETATTR.
When unlocking the lease for the delegation, clear FMODE_NOCMTIME. If
the file has been written, but no setattr for the delegated mtime and
ctime has been done, update the timestamps to current_time().
Suggested-by: NeilBrown <neil@brown.name>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>1 parent b40b1ba commit e5e9b24
3 files changed
Lines changed: 69 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1151 | 1151 | | |
1152 | 1152 | | |
1153 | 1153 | | |
1154 | | - | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
1155 | 1157 | | |
1156 | 1158 | | |
1157 | 1159 | | |
| |||
1238 | 1240 | | |
1239 | 1241 | | |
1240 | 1242 | | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
1241 | 1256 | | |
1242 | 1257 | | |
1243 | 1258 | | |
1244 | 1259 | | |
1245 | 1260 | | |
1246 | 1261 | | |
| 1262 | + | |
1247 | 1263 | | |
1248 | 1264 | | |
1249 | 1265 | | |
| |||
1256 | 1272 | | |
1257 | 1273 | | |
1258 | 1274 | | |
1259 | | - | |
| 1275 | + | |
1260 | 1276 | | |
1261 | 1277 | | |
1262 | 1278 | | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
1263 | 1284 | | |
1264 | 1285 | | |
1265 | 1286 | | |
| |||
2550 | 2571 | | |
2551 | 2572 | | |
2552 | 2573 | | |
| 2574 | + | |
2553 | 2575 | | |
2554 | 2576 | | |
2555 | 2577 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1222 | 1222 | | |
1223 | 1223 | | |
1224 | 1224 | | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
1225 | 1261 | | |
1226 | 1262 | | |
1227 | 1263 | | |
1228 | 1264 | | |
1229 | 1265 | | |
1230 | 1266 | | |
1231 | 1267 | | |
| 1268 | + | |
1232 | 1269 | | |
1233 | 1270 | | |
1234 | 1271 | | |
| |||
6265 | 6302 | | |
6266 | 6303 | | |
6267 | 6304 | | |
| 6305 | + | |
| 6306 | + | |
6268 | 6307 | | |
6269 | 6308 | | |
6270 | 6309 | | |
| |||
6278 | 6317 | | |
6279 | 6318 | | |
6280 | 6319 | | |
| 6320 | + | |
| 6321 | + | |
| 6322 | + | |
6281 | 6323 | | |
6282 | 6324 | | |
6283 | 6325 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | | - | |
| 220 | + | |
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| 224 | + | |
| 225 | + | |
224 | 226 | | |
225 | 227 | | |
226 | 228 | | |
| |||
0 commit comments