Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-10501

Resource acquired to 'fd' at line 82 may be lost in project_get_xattr()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not a Bug
    • Minor
    • None
    • Lustre 2.11.0
    • 3
    • 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
      lfs_project.c:82: Resource is acquired: 'fd' in the call to 'open'

      An event which alters the program's state, leading to the defect
      lfs_project.c:93: Resource is lost: 'fd'

      Attachments

        Issue Links

          Activity

            People

              wc-triage WC Triage
              dmiter Dmitry Eremin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: