Details
-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
3
-
9223372036854775807
Description
static int mirror_extend_file(const char *fname, const char *victim_file, enum mirror_flags mirror_flags)
{
1251 fd = open(fname, O_RDWR);
1252 if (fd < 0) {...}
1257
1258 fdv = open(victim_file, O_RDWR);
1259 if (fdv < 0) {...}
1264
1265 if (fstat(fd, &stbuf) || fstat(fdv, &stbuf_v)) {...}
1270
1271 if (stbuf.st_dev != stbuf_v.st_dev) {...}
1276
1277 /* mirrors should be of the same size */
1278 if (stbuf.st_size != stbuf_v.st_size) {...}
1283
1284 rc = llapi_lease_get(fd, LL_LEASE_RDLCK);
1285 if (rc < 0) {...}
1289
1290 if (!(mirror_flags & NO_VERIFY)) {...}
1300
1301 /* Get rid of caching pages from clients */
1302 rc = llapi_get_data_version(fd, &dv, LL_DV_WR_FLUSH);
1303 if (rc < 0) {
1304 error_loc = "cannot get data version";
1305 return rc;
1306 }
TRACEBACK
An event which alters the program's state, leading to the defect
lfs.c:1251: Resource is acquired: 'fd' in the call to 'open'
An event which alters the program's state, leading to the defect
lfs.c:1305: Resource is lost: 'fd'
Resource acquired to 'fdv' at line 1258 may be lost here.
TRACEBACK
An event which alters the program's state, leading to the defect
lfs.c:1258: Resource is acquired: 'fdv' in the call to 'open'
An event which alters the program's state, leading to the defect
lfs.c:1305: Resource is lost: 'fdv'