Skip to content

Commit

Permalink
filestore: check ioctl WAIT_SYNC return value
Browse files Browse the repository at this point in the history
CID 716860: Unchecked return value (CHECKED_RETURN)
At (27): Calling function "ioctl(int, unsigned long, ...)" without checking return value (as is done elsewhere 29 out of 31 times).

Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
Sage Weil committed Oct 1, 2012
1 parent 15ebc0f commit 409fbb7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/os/FileStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3695,7 +3695,12 @@ void FileStore::sync_entry()

// wait for commit
dout(20) << " waiting for transid " << async_args.transid << " to complete" << dendl;
::ioctl(op_fd, BTRFS_IOC_WAIT_SYNC, &async_args.transid);
r = ::ioctl(op_fd, BTRFS_IOC_WAIT_SYNC, &async_args.transid);
if (r < 0) {
int err = errno;
derr << "ioctl WAIT_SYNC got " << cpp_strerror(err) << dendl;
assert(0 == "wait_sync got error");
}
dout(20) << " done waiting for transid " << async_args.transid << " to complete" << dendl;

} else {
Expand Down

0 comments on commit 409fbb7

Please sign in to comment.