Commit ea5dc04
cachefiles: unmark inode in use in error path
Unmark inode in use if error encountered. If the in-use flag leakage
occurs in cachefiles_open_file(), Cachefiles will complain "Inode
already in use" when later another cookie with the same index key is
looked up.
If the in-use flag leakage occurs in cachefiles_create_tmpfile(), though
the "Inode already in use" warning won't be triggered, fix the leakage
anyway.
Reported-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Fixes: 1f08c92 ("cachefiles: Implement backing file wrangling")
Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: linux-cachefs@redhat.com
Link: https://listman.redhat.com/archives/linux-cachefs/2022-March/006615.html # v1
Link: https://listman.redhat.com/archives/linux-cachefs/2022-March/006618.html # v21 parent 42e7a03 commit ea5dc04
1 file changed
Lines changed: 24 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
60 | 70 | | |
61 | 71 | | |
62 | 72 | | |
| |||
68 | 78 | | |
69 | 79 | | |
70 | 80 | | |
71 | | - | |
72 | | - | |
73 | | - | |
| 81 | + | |
74 | 82 | | |
75 | 83 | | |
76 | 84 | | |
| |||
484 | 492 | | |
485 | 493 | | |
486 | 494 | | |
487 | | - | |
| 495 | + | |
488 | 496 | | |
489 | 497 | | |
490 | 498 | | |
| |||
494 | 502 | | |
495 | 503 | | |
496 | 504 | | |
497 | | - | |
| 505 | + | |
498 | 506 | | |
499 | 507 | | |
500 | 508 | | |
501 | 509 | | |
502 | 510 | | |
503 | 511 | | |
| 512 | + | |
504 | 513 | | |
505 | 514 | | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
506 | 519 | | |
507 | 520 | | |
508 | 521 | | |
| |||
590 | 603 | | |
591 | 604 | | |
592 | 605 | | |
593 | | - | |
594 | | - | |
595 | | - | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
596 | 609 | | |
597 | | - | |
| 610 | + | |
| 611 | + | |
598 | 612 | | |
599 | 613 | | |
600 | 614 | | |
| 615 | + | |
601 | 616 | | |
602 | 617 | | |
603 | 618 | | |
| |||
0 commit comments