29 Jan, 2008

1 commit

  • The userspace ABI of ocfs2's internal cluster stack (o2cb) was broken by
    commit c60b71787982cefcf9fa09aa281fa8c4c685d557 "kset: convert ocfs2 to
    use kset_create". Specifically, the '/sys/o2cb' kset was moved to
    '/sys/fs/o2cb'. This breaks all ocfs2 tools and renders the
    filesystem unmountable.

    This fix moves '/sys/o2cb' back where it belongs.

    Signed-off-by: Joel Becker
    Signed-off-by: Mark Fasheh

    Joel Becker
     

26 Jan, 2008

25 commits

  • If we know a buffer_head is non-null, then brelse() is unnecessary and
    put_bh() can be used instead. Also, an explicit check for NULL is
    unnecessary when using brelse(). This patch only covers buffer_head_io.c and
    resize.c, which have recently added code which exhibits this problem.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     
  • ocfs2_super->blocked_lock_list and ocfs2_super->blocked_lock_count have some
    usage restrictions which aren't immediately obvious to anyone reading the
    code. It's a good idea to document this so that we avoid making costly
    mistakes in the future.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     
  • Bump the printed version to 1.5.0. This helps us quickly identify which
    version of Ocfs2 a bug filer is running.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     
  • Currently the process of dlm join contains 2 steps: query join and assert join.
    After query join, the joined node will set its joining_node. So if the joining
    node happens to panic before the 2nd step, the joined node will fail to clear
    its joining_node flag because that node isn't in the domain map. It at least
    cause 2 problems.
    1. All the new join request will fail. So no new node can mount the volume.
    2. The joined node can't umount the volume since during the umount process it
    has to wait for the joining_node to be unknown. So the umount will be hanged.

    The solution is to clear the joining_node before we check the domain map.

    Signed-off-by: Tao Ma
    Signed-off-by: Mark Fasheh

    Tao Ma
     
  • Convert byte order of constant instead of variable it will be done at
    compile time vs run time. Remove unused le32_and_cpu.

    Signed-off-by: Marcin Slusarz
    Signed-off-by: Mark Fasheh

    Marcin Slusarz
     
  • Lots of people are having trouble with the default timeouts, which are too
    low. These new values are derived from an informal survey taken on
    ocfs2-users, as well as data from bug reports. This should reduce the amount
    of cluster disconnects and subsequent fencing seen during normal workloads.

    Signed-off-by: Sunil Mushran
    Signed-off-by: Mark Fasheh

    Sunil Mushran
     
  • Explicitely convert loff_t to long long in printf. Just for sure...

    Signed-off-by: Jan Kara
    Signed-off-by: Mark Fasheh

    Jan Kara
     
  • We should use generic_file_llseek() and not default_llseek() so that
    s_maxbytes gets properly checked when seeking.

    Signed-off-by: Jan Kara
    Signed-off-by: Mark Fasheh

    Jan Kara
     
  • In ocfs2_read_inline_data() we should store file size in loff_t. Although
    the file size should fit in 32 bits we cannot be sure in case filesystem is
    corrupted.

    Signed-off-by: Jan Kara
    Signed-off-by: Mark Fasheh

    Jan Kara
     
  • Create separate lockdep lock classes for system file's i_mutexes. They are
    used to guard allocations and similar things and thus rank differently
    than i_mutex of a regular file or directory.

    Signed-off-by: Jan Kara
    Signed-off-by: Mark Fasheh

    Jan Kara
     
  • Hook up ocfs2_flock(), using the new flock lock type in dlmglue.c. A new
    mount option, "localflocks" is added so that users can revert to old
    functionality as need be.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     
  • This adds a new dlmglue lock type which is intended to back flock()
    requests.

    Since these locks are driven from userspace, usage rules are much more
    liberal than the typical Ocfs2 internal cluster lock. As a result, we can't
    make use of most dlmglue features - lock caching and lock level
    optimizations in particular. Additionally, userspace is free to deadlock
    itself, so we have to deal with that in the same way as the rest of the
    kernel - by allowing a signal to abort a lock request.

    In order to keep ocfs2_cluster_lock() complexity down, ocfs2_file_lock()
    does it's own dlm coordination. We still use the same helper functions
    though, so duplicated code is kept to a minimum.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     
  • Local alloc is a performance optimization in ocfs2 in which a node
    takes a window of bits from the global bitmap and then uses that for
    all small local allocations. This window size is fixed to 8MB currently.
    This patch allows users to specify the window size in MB including
    disabling it by passing in 0. If the number specified is too large,
    the fs will use the default value of 8MB.

    mount -o localalloc=X /dev/sdX /mntpoint

    Signed-off-by: Sunil Mushran
    Signed-off-by: Mark Fasheh

    Sunil Mushran
     
  • Mostly taken from ext3. This allows the user to set the jbd commit interval,
    in seconds. The default of 5 seconds stays the same, but now users can
    easily increase the commit interval. Typically, this would be increased in
    order to benefit performance at the expense of data-safety.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     
  • Check that an online resize is being driven by a user with permission to
    change system resource limits.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     
  • This patch adds the ability for a userspace program to request that a
    properly formatted cluster group be added to the main allocation bitmap for
    an Ocfs2 file system. The request is made via an ioctl, OCFS2_IOC_GROUP_ADD.
    On a high level, this is similar to ext3, but we use a different ioctl as
    the structure which has to be passed through is different.

    During an online resize, tunefs.ocfs2 will format any new cluster groups
    which must be added to complete the resize, and call OCFS2_IOC_GROUP_ADD on
    each one. Kernel verifies that the core cluster group information is valid
    and then does the work of linking it into the global allocation bitmap.

    Signed-off-by: Tao Ma
    Signed-off-by: Mark Fasheh

    Tao Ma
     
  • This patch adds the ability for a userspace program to request an extend of
    last cluster group on an Ocfs2 file system. The request is made via ioctl,
    OCFS2_IOC_GROUP_EXTEND. This is derived from EXT3_IOC_GROUP_EXTEND, but is
    obviously Ocfs2 specific.

    tunefs.ocfs2 would call this for an online-resize operation if the last
    cluster group isn't full.

    Signed-off-by: Tao Ma
    Signed-off-by: Mark Fasheh

    Tao Ma
     
  • This value is initialized from global_bitmap->id2.i_chain.cl_cpg. If there
    is only 1 group, it will be equal to the total clusters in the volume. So
    as for online resize, it should change for all the nodes in the cluster.
    It isn't easy and there is no corresponding lock for it.

    bitmap_cpg is only used in 2 areas:
    1. Check whether the suballoc is too large for us to allocate from the global
    bitmap, so it is little used. And now the suballoc size is 2048, it rarely
    meet this situation and the check is almost useless.
    2. Calculate which group a cluster belongs to. We use it during truncate to
    figure out which cluster group an extent belongs too. But we should be OK
    if we increase it though as the cluster group calculated shouldn't change
    and we only ever have a small bitmap_cpg on file systems with a single
    cluster group.

    Signed-off-by: Tao Ma
    Signed-off-by: Mark Fasheh

    Tao Ma
     
  • Add ->readpages support to Ocfs2. This is rather trivial - all it required
    is a small update to ocfs2_get_block (for mapping full extents via b_size)
    and an ocfs2_readpages() function which partially mirrors ocfs2_readpage().

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     
  • Call this the "inode_lock" now, since it covers both data and meta data.
    This patch makes no functional changes.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     
  • The meta lock now covers both meta data and data, so this just removes the
    now-redundant data lock.

    Combining locks saves us a round of lock mastery per inode and one less lock
    to ping between nodes during read/write.

    We don't lose much - since meta locks were always held before a data lock
    (and at the same level) ordered writeout mode (the default) ensured that
    flushing for the meta data lock also pushed out data anyways.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     
  • In order to extend inode lock coverage to inode data, we use the same data
    downconvert worker with only a small modification to only do work for
    regular files.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     
  • The node maps that are set/unset by these votes are no longer relevant, thus
    we can remove the mount and umount votes. Since those are the last two
    remaining votes, we can also remove the entire vote infrastructure.

    The vote thread has been renamed to the downconvert thread, and the small
    amount of functionality related to managing it has been moved into
    fs/ocfs2/dlmglue.c. All references to votes have been removed or updated.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     
  • Now that the dlm exposes domain information to us, we don't need generic
    node up / node down callbacks. And since the DLM is only telling us when a
    node goes down unexpectedly, we no longer need to optimize away node down
    callbacks via the umount map.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     
  • With this, a dlm client can take advantage of the group protocol in the dlm
    to get full notification whenever a node within the dlm domain leaves
    unexpectedly.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     

25 Jan, 2008

2 commits

  • Dynamically create the kset instead of declaring it statically.

    Also use the new kobj_attribute which cleans up this file a _lot_.

    Cc: Kay Sievers
    Cc: Mark Fasheh
    Cc: Kurt Hackel
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • We don't need a "default" ktype for a kset. We should set this
    explicitly every time for each kset. This change is needed so that we
    can make ksets dynamic, and cleans up one of the odd, undocumented
    assumption that the kset/kobject/ktype model has.

    This patch is based on a lot of help from Kay Sievers.

    Nasty bug in the block code was found by Dave Young

    Cc: Kay Sievers
    Cc: Dave Young
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

18 Dec, 2007

4 commits


06 Dec, 2007

1 commit

  • endianness annotations in networking code had been in place for quite a
    while; in particular, sin_port and s_addr are annotated as big-endian.

    Code in ocfs2 had __force casts added apparently to shut the sparse
    warnings up; of course, these days they only serve to *produce* warnings
    for no reason whatsoever...

    Signed-off-by: Al Viro
    Signed-off-by: Linus Torvalds

    Al Viro
     

28 Nov, 2007

7 commits

  • ocfs2_truncate() and ocfs2_remove_inode_range() had reversed their "set
    i_size" arguments to ocfs2_truncate_inline(). Fix things so that truncate
    sets i_size, and punching a hole ignores it.

    This exposed a problem where punching a hole in an inline-data file wasn't
    updating the page cache, so fix that too.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     
  • This was causing us to prematurely push out inline data by one byte.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     
  • The existing bug statement didn't take into account unhashed dentries which
    might not have a cluster lock on them. This could happen if a node exporting
    the file system via NFS is rebooted, re-exported to nfs clients and then
    unmounted. It's fine in this case to not have a dentry cluster lock.

    Just remove the bug statement and replace it with an error print, which
    does the proper checks. Though we want to know if something has happened
    which might have prevented a cluster lock from being created, it's
    definitely not necessary to panic the machine for this.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     
  • Enable expensive bitmap scanning only if DEBUG option is enabled.
    The bitmap scanning quite loads the CPU and on my machine the write
    throughput of dd if=/dev/zero of=/ocfs2/file bs=1M count=500 conv=sync
    improves from 37 MB/s to 45.4 MB/s in local mode...

    Signed-off-by: Jan Kara
    Signed-off-by: Mark Fasheh

    Jan Kara
     
  • If the inode block isn't valid then we don't want to print the value from
    that, instead print the block number which was passed in (which should
    always be correct). Also, turn this into a debug print for now - folks who
    hit an actual problem always have other logs indicating what the source is.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     
  • It's almost never worth printing in that situation and we keep forgetting to
    manually filter it out.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     
  • Signed-off-by: Joe Perches
    Signed-off-by: Mark Fasheh

    Joe Perches