[LU-10503] Resource acquired to 'fd' at line 1251 may be lost in mirror_extend_file() Created: 12/Jan/18 Updated: 25/Jan/18 Resolved: 25/Jan/18 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Lustre 2.11.0 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Dmitry Eremin (Inactive) | Assignee: | Jian Yu |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | kw | ||
| Severity: | 3 |
| Rank (Obsolete): | 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 An event which alters the program's state, leading to the defect Resource acquired to 'fdv' at line 1258 may be lost here. An event which alters the program's state, leading to the defect An event which alters the program's state, leading to the defect |
| Comments |
| Comment by Gerrit Updater [ 18/Jan/18 ] |
|
Jian Yu (jian.yu@intel.com) uploaded a new patch: https://review.whamcloud.com/30914 |
| Comment by Gerrit Updater [ 25/Jan/18 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/30914/ |
| Comment by Peter Jones [ 25/Jan/18 ] |
|
Landed for 2.11 |