Skip to content

Commit

Permalink
1). A minor grammar error was corrected in main() when the ENOENT
Browse files Browse the repository at this point in the history
	case is handled.

2). In both files, the header and the C code, these options are now
	accepted as passed through by mount in util-linux-2.24 when it execs mount.zfs:

	acl
	noacl
	posixacl
  • Loading branch information
renelson committed Dec 12, 2013
1 parent 5cb65ef commit 43adab1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cmd/mount_zfs/mount_zfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ static const option_map_t option_map[] = {
{ MNTOPT_SYNC, MS_SYNCHRONOUS, ZS_COMMENT },
{ MNTOPT_USER, MS_USERS, ZS_COMMENT },
{ MNTOPT_USERS, MS_USERS, ZS_COMMENT },
/* acl flags passed with util-linux-2.24 mount command */
{ MNTOPT_ACL, MS_COMMENT, ZS_COMMENT },
{ MNTOPT_NOACL, MS_COMMENT, ZS_COMMENT },
{ MNTOPT_POSIXACL, MS_COMMENT, ZS_COMMENT },

This comment has been minimized.

Copy link
@behlendorf

behlendorf Dec 14, 2013

Both MNTOPT_ACL and MNTOPT_POSIXACL should really be set to MS_POSIXACL. That way this mount flag will get passed down in to the kernel. Today it will be completely ignored but it should cause a temporary override of the acltype property for the duration of the mount. This isn't yet implemented under Linux see openzfs#985, but passing the flag would be a start.

#ifdef MS_NOATIME
{ MNTOPT_NOATIME, MS_NOATIME, ZS_COMMENT },
#endif
Expand Down Expand Up @@ -409,8 +413,7 @@ main(int argc, char **argv)
}

/* validate mount options and set mntflags */
error = parse_options(mntopts, &mntflags, &zfsflags, sloppy,
badopt, mtabopt);
error = parse_options(mntopts, &mntflags, &zfsflags, sloppy, badopt, mtabopt);

This comment has been minimized.

Copy link
@behlendorf

behlendorf Dec 14, 2013

[style] Please leave this as it was, there's 80 character limit.

if (error) {
switch (error) {
case ENOMEM:
Expand All @@ -420,7 +423,7 @@ main(int argc, char **argv)
return (MOUNT_SYSERR);
case ENOENT:
(void) fprintf(stderr, gettext("filesystem '%s' "
"cannot be mounted of due invalid option "
"cannot be mounted due to invalid option "

This comment has been minimized.

Copy link
@behlendorf

behlendorf Dec 14, 2013

It would be best to break this in to a separate patch. One for the acl changes and a second for the grammer fix. That way they can be merged independently when they are ready.

"'%s'.\n"), dataset, badopt);
(void) fprintf(stderr, gettext("Use the '-s' option "
"to ignore the bad mount option.\n"));
Expand Down
4 changes: 4 additions & 0 deletions lib/libspl/include/sys/mntent.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@
#define MNTOPT_COMMENT "comment" /* comment */
#define MNTOPT_ZFSUTIL "zfsutil" /* called by zfs utility */

#define MNTOPT_ACL "acl" /* parameters passed by util-linux-2.24 mount */
#define MNTOPT_NOACL "noacl" /* likewise */
#define MNTOPT_POSIXACL "posixacl" /* likewise */

#define ZS_COMMENT 0x00000000 /* comment */
#define ZS_ZFSUTIL 0x00000001 /* caller is zfs(8) */
#define ZS_NOCONTEXT 0x00000002 /* do not add selinux context */
Expand Down

0 comments on commit 43adab1

Please sign in to comment.