Repository navigation
Commit 1e2e547
Al Viro
do d_instantiate/unlock_new_inode combinations safely
For anything NFS-exported we do _not_ want to unlock new inode
before it has grown an alias; original set of fixes got the
ordering right, but missed the nasty complication in case of
lockdep being enabled - unlock_new_inode() does
lockdep_annotate_inode_mutex_key(inode)
which can only be done before anyone gets a chance to touch
->i_mutex. Unfortunately, flipping the order and doing
unlock_new_inode() before d_instantiate() opens a window when
mkdir can race with open-by-fhandle on a guessed fhandle, leading
to multiple aliases for a directory inode and all the breakage
that follows from that.
Correct solution: a new primitive (d_instantiate_new())
combining these two in the right order - lockdep annotate, then
d_instantiate(), then the rest of unlock_new_inode(). All
combinations of d_instantiate() with unlock_new_inode() should
be converted to that.
Cc: stable@kernel.org # 2.6.29 and later
Tested-by: Mike Marshall <hubcap@omnibond.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>1 parent d7760d6 commit 1e2e547
14 files changed
Lines changed: 57 additions & 72 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6575 | 6575 | | |
6576 | 6576 | | |
6577 | 6577 | | |
6578 | | - | |
6579 | | - | |
| 6578 | + | |
6580 | 6579 | | |
6581 | 6580 | | |
6582 | 6581 | | |
| |||
6652 | 6651 | | |
6653 | 6652 | | |
6654 | 6653 | | |
6655 | | - | |
6656 | | - | |
| 6654 | + | |
6657 | 6655 | | |
6658 | 6656 | | |
6659 | 6657 | | |
| |||
6798 | 6796 | | |
6799 | 6797 | | |
6800 | 6798 | | |
6801 | | - | |
6802 | | - | |
6803 | | - | |
6804 | | - | |
6805 | | - | |
6806 | | - | |
| 6799 | + | |
6807 | 6800 | | |
6808 | 6801 | | |
6809 | 6802 | | |
| |||
10246 | 10239 | | |
10247 | 10240 | | |
10248 | 10241 | | |
10249 | | - | |
10250 | | - | |
| 10242 | + | |
10251 | 10243 | | |
10252 | 10244 | | |
10253 | 10245 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1899 | 1899 | | |
1900 | 1900 | | |
1901 | 1901 | | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
1902 | 1924 | | |
1903 | 1925 | | |
1904 | 1926 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
286 | | - | |
287 | | - | |
| 286 | + | |
288 | 287 | | |
289 | 288 | | |
290 | 289 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
| 44 | + | |
46 | 45 | | |
47 | 46 | | |
48 | 47 | | |
| |||
255 | 254 | | |
256 | 255 | | |
257 | 256 | | |
258 | | - | |
259 | | - | |
| 257 | + | |
260 | 258 | | |
261 | 259 | | |
262 | 260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2411 | 2411 | | |
2412 | 2412 | | |
2413 | 2413 | | |
2414 | | - | |
2415 | | - | |
| 2414 | + | |
2416 | 2415 | | |
2417 | 2416 | | |
2418 | 2417 | | |
| |||
2651 | 2650 | | |
2652 | 2651 | | |
2653 | 2652 | | |
2654 | | - | |
2655 | | - | |
| 2653 | + | |
2656 | 2654 | | |
2657 | 2655 | | |
2658 | 2656 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
297 | | - | |
298 | | - | |
| 297 | + | |
299 | 298 | | |
300 | 299 | | |
301 | 300 | | |
| |||
597 | 596 | | |
598 | 597 | | |
599 | 598 | | |
600 | | - | |
601 | | - | |
| 599 | + | |
602 | 600 | | |
603 | 601 | | |
604 | 602 | | |
| |||
661 | 659 | | |
662 | 660 | | |
663 | 661 | | |
664 | | - | |
665 | | - | |
| 662 | + | |
666 | 663 | | |
667 | 664 | | |
668 | 665 | | |
| |||
713 | 710 | | |
714 | 711 | | |
715 | 712 | | |
716 | | - | |
717 | | - | |
| 713 | + | |
718 | 714 | | |
719 | 715 | | |
720 | 716 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
213 | | - | |
| 212 | + | |
214 | 213 | | |
215 | 214 | | |
216 | 215 | | |
| |||
430 | 429 | | |
431 | 430 | | |
432 | 431 | | |
433 | | - | |
434 | | - | |
| 432 | + | |
435 | 433 | | |
436 | 434 | | |
437 | 435 | | |
| |||
575 | 573 | | |
576 | 574 | | |
577 | 575 | | |
578 | | - | |
579 | | - | |
| 576 | + | |
580 | 577 | | |
581 | 578 | | |
582 | 579 | | |
| |||
747 | 744 | | |
748 | 745 | | |
749 | 746 | | |
750 | | - | |
751 | | - | |
| 747 | + | |
752 | 748 | | |
753 | 749 | | |
754 | 750 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
182 | | - | |
| 181 | + | |
183 | 182 | | |
184 | 183 | | |
185 | 184 | | |
| |||
313 | 312 | | |
314 | 313 | | |
315 | 314 | | |
316 | | - | |
317 | | - | |
| 315 | + | |
318 | 316 | | |
319 | 317 | | |
320 | 318 | | |
| |||
1059 | 1057 | | |
1060 | 1058 | | |
1061 | 1059 | | |
1062 | | - | |
1063 | | - | |
| 1060 | + | |
1064 | 1061 | | |
1065 | 1062 | | |
1066 | 1063 | | |
| |||
1447 | 1444 | | |
1448 | 1445 | | |
1449 | 1446 | | |
1450 | | - | |
1451 | | - | |
| 1447 | + | |
1452 | 1448 | | |
1453 | 1449 | | |
1454 | 1450 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
| 49 | + | |
51 | 50 | | |
52 | 51 | | |
53 | 52 | | |
| |||
243 | 242 | | |
244 | 243 | | |
245 | 244 | | |
246 | | - | |
247 | | - | |
| 245 | + | |
248 | 246 | | |
249 | 247 | | |
250 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | | - | |
| 78 | + | |
80 | 79 | | |
81 | 80 | | |
82 | 81 | | |
| |||
332 | 331 | | |
333 | 332 | | |
334 | 333 | | |
335 | | - | |
336 | | - | |
| 334 | + | |
337 | 335 | | |
338 | 336 | | |
339 | 337 | | |
| |||
402 | 400 | | |
403 | 401 | | |
404 | 402 | | |
405 | | - | |
406 | | - | |
| 403 | + | |
407 | 404 | | |
408 | 405 | | |
409 | 406 | | |
| |||
0 commit comments