Skip to contentSkip to conversation

btrfsctl returns bad exit status

DISCUSSION K. Richard Pixley 2 participants 3 messages Jul 23, 2010 1 message not in the archive Btrfs file system

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Using btrfsctl from ubuntu maverick, (built and running on ubuntu-10.04), I get:

rich@eisenhower> btrfsctl -s snap1 /home || echo failed operation complete
Btrfs Btrfs v0.19
failed
rich@eisenhower> ls -las snap1
total 4
4 drwxr-xr-x 1 root root 32 2010-07-20 18:25 .
0 drwxr-xr-x 1 rich rich 1324 2010-07-21 12:47 ..
0 drwxr-xr-x 1 checker build 22 2010-07-20 18:21 checker
0 drwxr-xr-x 1 rich rich 1322 2010-07-21 12:44 rich
0 drwxr-xr-x 1 root root 36 2010-07-21 10:47 za-cb

This would seem to indicate a non-zero exit status despite the fact that the snapshotting operation appears to have succeeded. This makes it impossible to programmatically check whether a snapshot was created successfully or not as I will need to explicitly discard the exit status from btrfsctl.

I get the same results when built from git, except that it identifies itself as "v0.19-16-g075587c".

I would expect that btrfsctl would return zero exit status when it was capable of doing what it was asked and non-zero exit status only when it could not.

--rich

#2 lore raw

Try using "btrfs" tool; btrfsctl is/will be deprecated I think... and it's better anyway.

C Anthony [mobile]

Quoted 34 lines · K. Richard Pixley

Using btrfsctl from ubuntu maverick, (built and running on ubuntu-10.04), I get:

rich@eisenhower> btrfsctl -s snap1 /home || echo failed operation complete
Btrfs Btrfs v0.19
failed
rich@eisenhower> ls -las snap1
total 4
4 drwxr-xr-x 1 root root 32 2010-07-20 18:25 .
0 drwxr-xr-x 1 rich rich 1324 2010-07-21 12:47 ..
0 drwxr-xr-x 1 checker build 22 2010-07-20 18:21 checker
0 drwxr-xr-x 1 rich rich 1322 2010-07-21 12:44 rich
0 drwxr-xr-x 1 root root 36 2010-07-21 10:47 za-cb

This would seem to indicate a non-zero exit status despite the fact that the snapshotting operation appears to have succeeded. This makes it impossible to programmatically check whether a snapshot was created successfully or not as I will need to explicitly discard the exit status from btrfsctl.

I get the same results when built from git, except that it identifies itself as "v0.19-16-g075587c".

I would expect that btrfsctl would return zero exit status when it was capable of doing what it was asked and non-zero exit status only when it could not.

--rich
--
To unsubscribe from this list: send the line "unsubscribe linux- btrfs" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

Ah! Thanks.

Wiki page needs to be updated then. It shows btrfsctl and doesn't mention btrfs.

This one: https://btrfs.wiki.kernel.org/index.php/Getting_started

--rich

Quoted 45 lines · C Anthony Risinger

Try using "btrfs" tool; btrfsctl is/will be deprecated I think... and it's better anyway.

C Anthony [mobile]

Quoted 28 lines · K. Richard Pixley

Using btrfsctl from ubuntu maverick, (built and running on ubuntu-10.04), I get:

rich@eisenhower> btrfsctl -s snap1 /home || echo failed operation complete
Btrfs Btrfs v0.19
failed
rich@eisenhower> ls -las snap1
total 4
4 drwxr-xr-x 1 root root 32 2010-07-20 18:25 .
0 drwxr-xr-x 1 rich rich 1324 2010-07-21 12:47 ..
0 drwxr-xr-x 1 checker build 22 2010-07-20 18:21 checker
0 drwxr-xr-x 1 rich rich 1322 2010-07-21 12:44 rich
0 drwxr-xr-x 1 root root 36 2010-07-21 10:47 za-cb

This would seem to indicate a non-zero exit status despite the fact that the snapshotting operation appears to have succeeded. This makes it impossible to programmatically check whether a snapshot was created successfully or not as I will need to explicitly discard the exit status from btrfsctl.

I get the same results when built from git, except that it identifies itself as "v0.19-16-g075587c".

I would expect that btrfsctl would return zero exit status when it was capable of doing what it was asked and non-zero exit status only when it could not.

Quoted 6 lines

--rich
--
To unsubscribe from this list: send the line "unsubscribe linux- btrfs" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html