History

9p: fix fid refcount leak in v9fs_vfs_atomic_open_dotl

We need to release directory fid if we fail halfway through open This fixes fid leaking with xfstests generic 531

Dominique Martinet committed 4 years ago

Commit beca7741 parent b13bacc1 file · +3 −0Browse files

Unified · Split

fs/9p/vfs_inode_dotl.c+3−0
@@ -274,6 +274,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry, · 273 unmodified lines
274 if (IS_ERR(ofid)) {274 if (IS_ERR(ofid)) {
275 err = PTR_ERR(ofid);275 err = PTR_ERR(ofid);
276 p9_debug(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err);276 p9_debug(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err);
277 p9_client_clunk(dfid);
277 goto out;278 goto out;
278 }279 }
279 280
@@ -285,6 +286,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry, · 5 unmodified lines
285 if (err) {286 if (err) {
286 p9_debug(P9_DEBUG_VFS, "Failed to get acl values in creat %d\n",287 p9_debug(P9_DEBUG_VFS, "Failed to get acl values in creat %d\n",
287 err);288 err);
289 p9_client_clunk(dfid);
288 goto error;290 goto error;
289 }291 }
290 err = p9_client_create_dotl(ofid, name, v9fs_open_to_dotl_flags(flags),292 err = p9_client_create_dotl(ofid, name, v9fs_open_to_dotl_flags(flags),
@@ -292,6 +294,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry, · 1 unmodified line
292 if (err < 0) {294 if (err < 0) {
293 p9_debug(P9_DEBUG_VFS, "p9_client_open_dotl failed in creat %d\n",295 p9_debug(P9_DEBUG_VFS, "p9_client_open_dotl failed in creat %d\n",
294 err);296 err);
297 p9_client_clunk(dfid);
295 goto error;298 goto error;
296 }299 }
297 v9fs_invalidate_inode_attr(dir);300 v9fs_invalidate_inode_attr(dir);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t