Commit fa04a40
committed
afs: Fix to take ref on page when PG_private is set
Fix afs to take a ref on a page when it sets PG_private on it and to drop
the ref when removing the flag.
Note that in afs_write_begin(), a lot of the time, PG_private is already
set on a page to which we're going to add some data. In such a case, we
leave the bit set and mustn't increment the page count.
As suggested by Matthew Wilcox, use attach/detach_page_private() where
possible.
Fixes: 31143d5 ("AFS: implement basic file write support")
Reported-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>1 parent d383e34 commit fa04a40
4 files changed
Lines changed: 18 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
285 | | - | |
| 284 | + | |
286 | 285 | | |
287 | 286 | | |
288 | 287 | | |
| |||
1975 | 1974 | | |
1976 | 1975 | | |
1977 | 1976 | | |
1978 | | - | |
1979 | | - | |
| 1977 | + | |
1980 | 1978 | | |
1981 | 1979 | | |
1982 | 1980 | | |
| |||
2003 | 2001 | | |
2004 | 2002 | | |
2005 | 2003 | | |
2006 | | - | |
2007 | | - | |
2008 | | - | |
2009 | | - | |
| 2004 | + | |
| 2005 | + | |
2010 | 2006 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
| 246 | + | |
| 247 | + | |
250 | 248 | | |
251 | 249 | | |
252 | 250 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
627 | 627 | | |
628 | 628 | | |
629 | 629 | | |
630 | | - | |
| 630 | + | |
631 | 631 | | |
632 | 632 | | |
633 | | - | |
634 | | - | |
635 | 633 | | |
636 | 634 | | |
637 | 635 | | |
| |||
661 | 659 | | |
662 | 660 | | |
663 | 661 | | |
664 | | - | |
| 662 | + | |
665 | 663 | | |
666 | 664 | | |
667 | | - | |
668 | | - | |
669 | 665 | | |
670 | 666 | | |
671 | 667 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
155 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
156 | 158 | | |
157 | 159 | | |
158 | 160 | | |
| |||
334 | 336 | | |
335 | 337 | | |
336 | 338 | | |
337 | | - | |
| 339 | + | |
338 | 340 | | |
339 | 341 | | |
340 | | - | |
341 | 342 | | |
342 | 343 | | |
343 | 344 | | |
| |||
863 | 864 | | |
864 | 865 | | |
865 | 866 | | |
866 | | - | |
867 | | - | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
868 | 871 | | |
869 | 872 | | |
870 | 873 | | |
| |||
926 | 929 | | |
927 | 930 | | |
928 | 931 | | |
| 932 | + | |
929 | 933 | | |
930 | 934 | | |
931 | | - | |
932 | | - | |
933 | 935 | | |
934 | 936 | | |
935 | 937 | | |
| |||
0 commit comments