Commit d201c4d
pnfs: fix race in filelayout commit path
Hold the lock while modifying commit info dataserver buckets.
The following oops can be reproduced by running iozone for a while against
a 2 DS pynfs filelayout server.
general protection fault: 0000 [#1] SMP DEBUG_PAGEALLOC
Modules linked in: nfs_layout_nfsv41_files rpcsec_gss_krb5 nfsv4 nfs fscache
CPU: 0 PID: 903 Comm: iozone Not tainted 3.15.0-rc1-branch-dros_testing+ hardkernel#44
Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference
task: ffff880078164480 ti: ffff88006e972000 task.ti: ffff88006e972000
RIP: 0010:[<ffffffffa01936e1>] [<ffffffffa01936e1>] nfs_init_commit+0x22/0x
RSP: 0018:ffff88006e973d30 EFLAGS: 00010246
RAX: ffff88006e973e00 RBX: ffff88006e828800 RCX: ffff88006e973e10
RDX: 0000000000000000 RSI: ffff88006e973e00 RDI: dead4ead00000000
RBP: ffff88006e973d38 R08: ffff88006e8289d8 R09: 0000000000000000
R10: ffff88006e8289d8 R11: 0000000000016988 R12: ffff88006e973b98
R13: ffff88007a0a6648 R14: ffff88006e973e10 R15: ffff88006e828800
FS: 00007f2ce396b740(0000) GS:ffff88007f200000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f03278a1000 CR3: 0000000079043000 CR4: 00000000001407f0
Stack:
ffff88006e8289d8 ffff88006e973da8 ffffffffa00f144f ffff88006e9478c0
ffff88006e973e00 ffff88006de21080 0000000100000002 ffff880079be6c48
ffff88006e973d70 ffff88006e973d70 ffff88006e973e10 ffff88006de21080
Call Trace:
[<ffffffffa00f144f>] filelayout_commit_pagelist+0x1ae/0x34a [nfs_layout_nfsv
[<ffffffffa0194f72>] nfs_generic_commit_list+0x92/0xc4 [nfs]
[<ffffffffa0195053>] nfs_commit_inode+0xaf/0x114 [nfs]
[<ffffffffa01892bd>] nfs_file_fsync_commit+0x82/0xbe [nfs]
[<ffffffffa01ceb0d>] nfs4_file_fsync+0x59/0x9b [nfsv4]
[<ffffffff8114ee3c>] vfs_fsync_range+0x18/0x20
[<ffffffff8114ee60>] vfs_fsync+0x1c/0x1e
[<ffffffffa01891c2>] nfs_file_flush+0x7f/0x84 [nfs]
[<ffffffff81127a43>] filp_close+0x3c/0x72
[<ffffffff81140e12>] __close_fd+0x82/0x9a
[<ffffffff81127a9c>] SyS_close+0x23/0x4c
[<ffffffff814acd12>] system_call_fastpath+0x16/0x1b
Code: 5b 41 5c 41 5d 41 5e 5d c3 0f 1f 44 00 00 55 48 89 e5 53 48 89 fb 48 8
RIP [<ffffffffa01936e1>] nfs_init_commit+0x22/0xe1 [nfs]
RSP <ffff88006e973d30>
---[ end trace 732fe6419b235e2f ]---
Suggested-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Weston Andros Adamson <dros@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>1 parent 41d8d5b commit d201c4d
1 file changed
Lines changed: 16 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1067 | 1067 | | |
1068 | 1068 | | |
1069 | 1069 | | |
| 1070 | + | |
1070 | 1071 | | |
1071 | 1072 | | |
1072 | 1073 | | |
| |||
1080 | 1081 | | |
1081 | 1082 | | |
1082 | 1083 | | |
| 1084 | + | |
1083 | 1085 | | |
1084 | 1086 | | |
1085 | 1087 | | |
| |||
1176 | 1178 | | |
1177 | 1179 | | |
1178 | 1180 | | |
| 1181 | + | |
1179 | 1182 | | |
1180 | 1183 | | |
1181 | 1184 | | |
| |||
1220 | 1223 | | |
1221 | 1224 | | |
1222 | 1225 | | |
| 1226 | + | |
1223 | 1227 | | |
1224 | 1228 | | |
| 1229 | + | |
1225 | 1230 | | |
1226 | 1231 | | |
1227 | 1232 | | |
1228 | | - | |
1229 | | - | |
| 1233 | + | |
1230 | 1234 | | |
1231 | | - | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
1232 | 1238 | | |
1233 | 1239 | | |
1234 | 1240 | | |
| |||
1243 | 1249 | | |
1244 | 1250 | | |
1245 | 1251 | | |
| 1252 | + | |
1246 | 1253 | | |
1247 | 1254 | | |
1248 | 1255 | | |
| |||
1253 | 1260 | | |
1254 | 1261 | | |
1255 | 1262 | | |
| 1263 | + | |
1256 | 1264 | | |
1257 | 1265 | | |
| 1266 | + | |
1258 | 1267 | | |
1259 | 1268 | | |
1260 | 1269 | | |
| |||
1264 | 1273 | | |
1265 | 1274 | | |
1266 | 1275 | | |
1267 | | - | |
| 1276 | + | |
| 1277 | + | |
1268 | 1278 | | |
| 1279 | + | |
| 1280 | + | |
1269 | 1281 | | |
1270 | 1282 | | |
1271 | 1283 | | |
| |||
0 commit comments