Code Monkey home page Code Monkey logo

mosaic's People

Contributors

kolyshkin avatar ligurio avatar xemul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

kolyshkin openvz

mosaic's Issues

Commit 4bc1e42 breaks mosaic_open()

In commit 4bc1e42 there is a call to readlink(). Note that readlink() only works for symbolic links and returns -1 for other types of files (i.e. non-symlinks). Result is:

[root@kir-tpad test-rm-me-ALqR1prS]# ../../moctl/moctl ./plain.mos mount - mmnt
mosaic.c/68:ERROR: Path  doesn't look like mosaic config
Error opening mosaic ./plain.mos

I can think of a few ways to fix it, but first I need to understand why you need it in the first place. I don't quite understand the explanation, what I can understand is you want to have some sort of unique ID. The problem is a file name (with the path and the suffix stripped) is not a unique ID. An absolute file name can be. A pair of device + inode can be.

So, back to ways to fix this are:

  1. Use stat() to see if name is symlink, and call readlink() only if it is.
  2. Use realpath() instead of readlink(). This would work (and maybe you had that in mind) but it seems worthless as the next step is discarding the path to the file.
  3. Use something else as ID. I suggest an absolute path name.

multiple mosaic mounts vs umount

(filing it for myself so I won't forget)

Mount a mosaic a few times, and you won't be able to unmount it:

# ../../moctl/moctl ./plain.mos mount - plain.dir/
# ../../moctl/moctl ./plain.mos moun - plain.dir/
# ../../moctl/moctl ./plain.mos m - plain.dir/
# ../../moctl/moctl ./plain.mos umount - plain.dir/
Can't umount mosaic: Device or resource busy

A workaround is to use system umount utility.

I guess the best way to fix it is to use refcounting against mount.

[RFC] CLI improvement

moctl tool with two main types of entities:
1 a mosaic (as a whole);
2 an (individual) volume.

These two types are very different in nature, but the moctl actions we use on them are sometimes intersect. In particular, moctl mount and moctl umount can refer to the mosaic or a volume, so we have to introduce a special volume name, -, meaning "the mosaic itself".

Currently, we have almost 10 volume-related commands, and only 3 mosaic commands (mount, umount and info). To avoid confusion, I propose to prepend the literal word mosaic for mosaic-related commands, leaving volume-related ones as is.

Example:
moctl NAME mount - MOUNTPOINT --> moctl NAME mosaic mount MOUNTPOINT

The alternative I considered (and refused) is to use volume for where the volume name is, such as: moctl NAME mount volume VOLNAME MOUNTPOINT for volume, and moctl NAME mount MOUNTPOINT for the mosaic itself.

What do you think?

[RFC] Rename 'new' to 'create'

All the actions with volumes are verbs, but 'new' is an adjective.

I suggest using make or create. Create sounds better to me as it's closer to clone, and create and clone are the only two possible ways to make a new volume.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.