Skip to content

Commit

Permalink
qga: ignore EBUSY when freezing a filesystem
Browse files Browse the repository at this point in the history
the current implementation fails if we try to freeze an
already frozen filesystem. This can happen if a filesystem
is mounted more than once (e.g. with a bind mount).

Suggested-by: Christian Theune <[email protected]>
Cc: [email protected]
Signed-off-by: Peter Lieven <[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
Signed-off-by: Michael Roth <[email protected]>
  • Loading branch information
plieven authored and mdroth committed Mar 6, 2017
1 parent 26de229 commit ce2eb6c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion qga/commands-posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -1243,14 +1243,17 @@ int64_t qmp_guest_fsfreeze_freeze_list(bool has_mountpoints,
* filesystems may not implement fsfreeze for less obvious reasons.
* these will report EOPNOTSUPP. we simply ignore these when tallying
* the number of frozen filesystems.
* if a filesystem is mounted more than once (aka bind mount) a
* consecutive attempt to freeze an already frozen filesystem will
* return EBUSY.
*
* any other error means a failure to freeze a filesystem we
* expect to be freezable, so return an error in those cases
* and return system to thawed state.
*/
ret = ioctl(fd, FIFREEZE);
if (ret == -1) {
if (errno != EOPNOTSUPP) {
if (errno != EOPNOTSUPP && errno != EBUSY) {
error_setg_errno(errp, errno, "failed to freeze %s",
mount->dirname);
close(fd);
Expand Down

0 comments on commit ce2eb6c

Please sign in to comment.