Commit fe5c13d
committed
client: fix leak of file handles
Based on posix specification, the fd passed to fdopendir() will be
closed by closedir(). However CephFS client wasn't doing that. If the
user opened a directory using ceph_openat(), for example, and then
passed the returned fd to ceph_fdopendir(), the created Fh associated
with the new open was never destroyed.
This patch records the fd used in ceph_fdopendir() so that it can be
closed when ceph_closedir() is called.
Fixes: https://tracker.ceph.com/issues/64479
Signed-off-by: Xavi Hernandez <[email protected]>1 parent f83cac6 commit fe5c13d
2 files changed
+17
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
260 | | - | |
| 260 | + | |
261 | 261 | | |
262 | 262 | | |
263 | | - | |
| 263 | + | |
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| |||
9122 | 9122 | | |
9123 | 9123 | | |
9124 | 9124 | | |
9125 | | - | |
| 9125 | + | |
| 9126 | + | |
| 9127 | + | |
9126 | 9128 | | |
9127 | 9129 | | |
9128 | 9130 | | |
9129 | 9131 | | |
9130 | 9132 | | |
9131 | 9133 | | |
9132 | 9134 | | |
9133 | | - | |
| 9135 | + | |
9134 | 9136 | | |
9135 | 9137 | | |
9136 | 9138 | | |
9137 | | - | |
| 9139 | + | |
9138 | 9140 | | |
9139 | 9141 | | |
9140 | 9142 | | |
| |||
9162 | 9164 | | |
9163 | 9165 | | |
9164 | 9166 | | |
| 9167 | + | |
| 9168 | + | |
| 9169 | + | |
| 9170 | + | |
| 9171 | + | |
| 9172 | + | |
9165 | 9173 | | |
9166 | 9174 | | |
9167 | 9175 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| 243 | + | |
| 244 | + | |
243 | 245 | | |
244 | 246 | | |
245 | 247 | | |
| |||
1563 | 1565 | | |
1564 | 1566 | | |
1565 | 1567 | | |
1566 | | - | |
| 1568 | + | |
1567 | 1569 | | |
1568 | 1570 | | |
1569 | 1571 | | |
| |||
0 commit comments