[LU-10501] Resource acquired to 'fd' at line 82 may be lost in project_get_xattr() Created: 12/Jan/18 Updated: 29/Jan/22 Resolved: 29/Jan/22 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.11.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Dmitry Eremin (Inactive) | Assignee: | WC Triage |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | kw | ||
| Issue Links: |
|
||||||||
| Severity: | 3 | ||||||||
| Rank (Obsolete): | 9223372036854775807 | ||||||||
| Description |
78 static int project_get_xattr(const char *pathname, struct fsxattr *fsx)
79 {
80 int ret, fd;
81
82 fd = open(pathname, O_RDONLY | O_NOCTTY);
83 if (fd < 0) {...}
88
89 ret = ioctl(fd, LL_IOC_FSGETXATTR, fsx);
90 if (ret) {
91 fprintf(stderr, "%s: failed to get xattr for '%s': %s\n",
92 progname, pathname, strerror(errno));
93 return -errno;
94 }
95 return fd;
96 }
TRACEBACK An event which alters the program's state, leading to the defect An event which alters the program's state, leading to the defect |