Project

General

Profile

Actions

Bug #3485

closed

statd is not handling incoming SM_NOTIFY properly when the hostname is not resolvable

Added by Marcel Telka over 8 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
nfs - NFS server and client
Start date:
2013-01-19
Due date:
% Done:

90%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

Steps to reproduce:

Prerequisites:

  • illumos based NFS server named SERVER
  • an NFS client with hostname CLIENT. The client's hostname CLIENT should not be resolvable at the SERVER.

Steps:

  1. On the NFS server share a directory and make it writable by everybody. Let say the shared directory is /DIR.
  2. On the NFS client mount the shared directory from the SERVER: mount -o vers=3 SERVER:/DIR /mnt
  3. On the client run an application that will lock a file. I use the locker testing application (see below for the source): ./locker /mnt/a
  4. At the server make sure the lock is held: echo ::nlm_lockson | mdb -k
  5. Turn off the NFS client (normal reboot is not enough!).
  6. Boot the NFS client back.
  7. At the NFS server check whether there is still the lock held by the NFS client: echo ::nlm_lockson | mdb -k

Issue: The lock is still held at the NFS server.

Expected results: The lock should no longer be there.

/*
 * locker.c
 */

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>

int
main(int argc, char *argv[])
{
        int f;

        if (argc != 2) {
                printf("missing filename\\n");
                return 1;
        }

        f = open(argv[1], O_CREAT | O_RDWR, 0777);

        if (f < 0) {
                printf("open failed\\n");
                return 1;
        }

        if (lockf(f, F_LOCK, 0) != 0) {
                printf("lockf failed\\n");
                return 1;
        }

        for (;;)
                sleep(10);

        return 0;
}
Actions

Also available in: Atom PDF