Skip to contentSkip to conversation

btrfs: Check error of btrfs_iget() in btrfs_search_path_in_tree_user()

PATCH In review Misono Tomohiro 2 participants 2 messages Jun 4, 2018 – Jun 5, 2018 1 message not in the archive Btrfs file system

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 btrfs: Check error of btrfs_iget() in btrfs_search_path_in_tree_user()

---

Hi david,

It seems that v8 patch I sent last week is missed and commit in misc-next tree is also a bit updated from v7, so I resend the fix as a separate patch.

Please fold this patch to current misc-next (head is the commit to be fixed:
"btrfs: Add unprivileged version of ino_lookup ioctl").

Thanks,
Tomohiro Misono

 fs/btrfs/ioctl.c | 4 ++++
 1 file changed, 4 insertions(+)
fs/btrfs/ioctl.c +4 -0
index d29992f7dc63..5556e9ea2a4b 100644
@@ -2438,6 +2438,10 @@ static int btrfs_search_path_in_tree_user(struct inode *inode,
 			}
 
 			temp_inode = btrfs_iget(sb, &key2, root, NULL);
+			if (IS_ERR(temp_inode)) {
+				ret = PTR_ERR(temp_inode);
+				goto out;
+			}
 			ret = inode_permission(temp_inode, MAY_READ | MAY_EXEC);
 			iput(temp_inode);
 			if (ret) {
Signature · 1 line
2.14.3
#2 lore raw
Quoted 10 lines · Misono Tomohiro

---

Hi david,

It seems that v8 patch I sent last week is missed and commit in misc-next tree is also a bit updated from v7, so I resend the fix as a separate patch.

Please fold this patch to current misc-next (head is the commit to be fixed:
"btrfs: Add unprivileged version of ino_lookup ioctl").

Somehow it got lost on the way to the pull request branch, there were several other things to fix in the patch so I forgot that one. This also means I cannot fold it so it needs to be separate, based on this patch. Thanks.