Commit dc717bfd authored by Anthony Liguori's avatar Anthony Liguori
Browse files

Merge remote-tracking branch 'aneesh/for-upstream' into staging

* aneesh/for-upstream:
  hw/9pfs: Remove O_NOATIME flag from 9pfs open() calls in readonly mode
  hw/9pfs: Update MAINTAINERS file
  fsdev: Fix parameter parsing for proxy helper
  hw/9pfs: Fix crash when mounting with synthfs
  hw/9pfs: Preserve S_ISGID
  hw/9pfs: Add new security model mapped-file.
parents a283b1b8 eed96860
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -56,11 +56,15 @@ typedef struct extended_ops {
 * On failure ignore the error.
 */
#define V9FS_SM_NONE                0x00000010
#define V9FS_RDONLY                 0x00000020
#define V9FS_PROXY_SOCK_FD          0x00000040
#define V9FS_PROXY_SOCK_NAME        0x00000080
/*
 * uid/gid part of .virtfs_meatadata namespace
 */
#define V9FS_SM_MAPPED_FILE         0x00000020
#define V9FS_RDONLY                 0x00000040
#define V9FS_PROXY_SOCK_FD          0x00000080
#define V9FS_PROXY_SOCK_NAME        0x00000100

#define V9FS_SEC_MASK               0x0000001C
#define V9FS_SEC_MASK               0x0000003C


typedef struct FileOperations FileOperations;
+8 −2
Original line number Diff line number Diff line
@@ -1036,7 +1036,13 @@ int main(int argc, char **argv)
        return -1;
    }

    if (*sock_name && (own_u == -1 || own_g == -1)) {
    if (sock_name && sock != -1) {
        fprintf(stderr, "both named socket and socket descriptor specified\n");
        usage(argv[0]);
        exit(EXIT_FAILURE);
    }

    if (sock_name && (own_u == -1 || own_g == -1)) {
        fprintf(stderr, "owner uid:gid not specified, ");
        fprintf(stderr,
                "owner uid:gid specifies who can access the socket file\n");
@@ -1064,7 +1070,7 @@ int main(int argc, char **argv)
    }

    do_log(LOG_INFO, "Started\n");
    if (*sock_name) {
    if (sock_name) {
        sock = proxy_socket(sock_name, own_u, own_g);
        if (sock < 0) {
            goto error;
+14 −0
Original line number Diff line number Diff line
@@ -76,6 +76,20 @@ int v9fs_co_fstat(V9fsPDU *pdu, V9fsFidState *fidp, struct stat *stbuf)
                err = -errno;
            }
        });
    /*
     * Some FS driver (local:mapped-file) can't support fetching attributes
     * using file descriptor. Use Path name in that case.
     */
    if (err == -EOPNOTSUPP) {
        err = v9fs_co_lstat(pdu, &fidp->path, stbuf);
        if (err == -ENOENT) {
            /*
             * fstat on an unlinked file. Work with partial results
             * returned from s->ops->fstat
             */
            err = 0;
        }
    }
    return err;
}

+0 −9
Original line number Diff line number Diff line
@@ -91,15 +91,6 @@ VirtIODevice *virtio_9p_init(DeviceState *dev, V9fsConf *conf)
        s->ctx.fs_root = NULL;
    }
    s->ctx.exops.get_st_gen = NULL;

    if (fse->export_flags & V9FS_SM_PASSTHROUGH) {
        s->ctx.xops = passthrough_xattr_ops;
    } else if (fse->export_flags & V9FS_SM_MAPPED) {
        s->ctx.xops = mapped_xattr_ops;
    } else if (fse->export_flags & V9FS_SM_NONE) {
        s->ctx.xops = none_xattr_ops;
    }

    len = strlen(conf->tag);
    if (len > MAX_TAG_LEN - 1) {
        fprintf(stderr, "mount tag '%s' (%d bytes) is longer than "
+2 −2
Original line number Diff line number Diff line
@@ -63,11 +63,11 @@ static int handle_update_file_cred(int dirfd, const char *name, FsCred *credp)
    if (fd < 0) {
        return fd;
    }
    ret = fchmod(fd, credp->fc_mode & 07777);
    ret = fchownat(fd, "", credp->fc_uid, credp->fc_gid, AT_EMPTY_PATH);
    if (ret < 0) {
        goto err_out;
    }
    ret = fchownat(fd, "", credp->fc_uid, credp->fc_gid, AT_EMPTY_PATH);
    ret = fchmod(fd, credp->fc_mode & 07777);
err_out:
    close(fd);
    return ret;
Loading