linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Eric Sandeen <sandeen@redhat.com>
Cc: linux-xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH 5/5] xfs_io: add label command
Date: Tue, 15 May 2018 14:32:41 +1000	[thread overview]
Message-ID: <20180515043241.GG23861@dastard> (raw)
In-Reply-To: <ef558e14-5b31-4c5a-a07c-3d2ac67dd993@redhat.com>

On Mon, May 14, 2018 at 12:43:20PM -0500, Eric Sandeen wrote:
> This adds a get/set label command to xfs_io.
....
> +static int
> +label_f(
> +	int		argc,
> +	char		**argv)
> +{
> +	int		error;
> +	char		label[FSLABEL_MAX];
> +
> +	if (argc == 1) {
> +		memset(&label, 0, sizeof(label));
> +		error = ioctl(file->fd, FS_IOC_GET_FSLABEL, &label);
> +	} else {
> +		strncpy(label, argv[1], sizeof(label));
> +		error = ioctl(file->fd, FS_IOC_SET_FSLABEL, &label);
> +	}
> +
> +	if (error)
> +		perror("label");

Need to set exitcode = 1 here so that xfs_io fails with a non-zero
exit status....

> +	else
> +		printf("label = \"%s\"\n", label);
> +
> +	return error;

Because this isn't the exit status - this is the "continue
processing the next command" return value. i.e. return 0 if we want
to continue, non-zero if we want to abort further CLI processing....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2018-05-15  4:33 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-14 17:30 [PATCH V2 0/5] xfs: online label Eric Sandeen
2018-05-14 17:35 ` [PATCH V2 1/5] fs: copy BTRFS_IOC_[SG]ET_FSLABEL to vfs Eric Sandeen
2018-05-14 17:37   ` Darrick J. Wong
2018-05-14 17:36 ` [PATCH 2/4] xfs: New function for secondary superblock updates Eric Sandeen
2018-05-15 20:17   ` Darrick J. Wong
2018-05-14 17:39 ` [PATCH 3/5 V2] xfs: implement online get/set fs label Eric Sandeen
2018-05-15  1:07   ` Darrick J. Wong
2018-05-16  1:04     ` Darrick J. Wong
2018-05-14 17:42 ` [PATCH 4/5] btrfs: use common label ioctl definitions Eric Sandeen
2018-05-14 21:41   ` Darrick J. Wong
2018-05-14 17:43 ` [PATCH 5/5] xfs_io: add label command Eric Sandeen
2018-05-15  4:32   ` Dave Chinner [this message]
2018-05-15 15:06     ` Eric Sandeen
2018-05-16  0:57       ` Dave Chinner
2018-05-15 15:32   ` [PATCH 5/5 V2] " Eric Sandeen
2018-05-15 20:12     ` Darrick J. Wong
2018-05-17 15:22     ` [PATCH 5/5 V3] " Eric Sandeen
2018-05-17 21:56       ` Dave Chinner
  -- strict thread matches above, loose matches on Subject: below --
2018-04-30 15:40 [PATCH 0/5] xfs: add online relabel capabilities Eric Sandeen
2018-04-30 15:48 ` [PATCH 5/5] xfs_io: add label command Eric Sandeen
2018-05-02 14:37   ` Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180515043241.GG23861@dastard \
    --to=david@fromorbit.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).