18 Oct, 2011

3 commits

  • As part of startup, the MMP initialization code does this:

    mmp->mmp_seq = seq = cpu_to_le32(mmp_new_seq());

    Next, mmp->mmp_seq is written out to disk, a delay happens, and then
    the MMP block is read back in and the sequence value is tested:

    if (seq != le32_to_cpu(mmp->mmp_seq)) {
    /* fail the mount */

    On a LE system such as x86, the *le32* functions do nothing and this
    works. Unfortunately, on a BE system such as ppc64, this comparison
    becomes:

    if (cpu_to_le32(new_seq) != le32_to_cpu(cpu_to_le32(new_seq)) {
    /* fail the mount */

    Except for a few palindromic sequence numbers, this test always causes
    the mount to fail, which makes MMP filesystems generally unmountable
    on ppc64. The attached patch fixes this situation.

    Signed-off-by: Darrick J. Wong
    Signed-off-by: "Theodore Ts'o"

    Darrick J. Wong
     
  • Current logic would print an error message only once, and then
    'failed_writes' would stay at 1. Rework the loop to increment
    'failed_writes' and print the error message every
    s_mmp_update_interval * 60 seconds, as intended according to the
    comment.

    Signed-off-by: Nikitas Angelinas
    Signed-off-by: Andrew Perepechko
    Signed-off-by: "Theodore Ts'o"
    Acked-by: Andreas Dilger

    Nikitas Angelinas
     
  • sysname holds "Linux" by default, i.e. what appears when doing a "uname
    -s"; nodename should be used to print the machine's hostname, i.e. what
    is returned when doing a "uname -n" or "hostname", and what
    gethostname(2)/sethostname(2) manipulate, in order to notify the
    administrator of the node which is contending to mount the filesystem.

    Acked-by: Andreas Dilger
    Signed-off-by: Nikitas Angelinas
    Signed-off-by: Andrew Perepechko
    Signed-off-by: "Theodore Ts'o"

    Nikitas Angelinas
     

25 May, 2011

1 commit

  • Prevent an ext4 filesystem from being mounted multiple times.
    A sequence number is stored on disk and is periodically updated (every 5
    seconds by default) by a mounted filesystem.
    At mount time, we now wait for s_mmp_update_interval seconds to make sure
    that the MMP sequence does not change.
    In case of failure, the nodename, bdevname and the time at which the MMP
    block was last updated is displayed.

    Signed-off-by: Andreas Dilger
    Signed-off-by: Johann Lombardi
    Signed-off-by: "Theodore Ts'o"

    Johann Lombardi