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
274274 if (IS_ERR(ofid)) {
275275 err = PTR_ERR(ofid);
276276 p9_debug(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err);
277+ p9_client_clunk(dfid);
277278 goto out;
278279 }
279280
@@ -285,6 +286,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry, · 5 unmodified lines
285286 if (err) {
286287 p9_debug(P9_DEBUG_VFS, "Failed to get acl values in creat %d\n",
287288 err);
289+ p9_client_clunk(dfid);
288290 goto error;
289291 }
290292 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
292294 if (err < 0) {
293295 p9_debug(P9_DEBUG_VFS, "p9_client_open_dotl failed in creat %d\n",
294296 err);
297+ p9_client_clunk(dfid);
295298 goto error;
296299 }
297300 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