Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-1546

stat returns link count 1 for unlinked but open files

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.4.0
    • Lustre 2.3.0, Lustre 2.1.2
    • # uname -r
      2.6.32-220.13.1.el6.l22.x86_64
      # cat /proc/fs/lustre/version
      lustre: 2.2.55
      kernel: patchless_client
      build: 2.2.55-gef32640-CHANGED-2.6.32-220.13.1.el6.l22.x86_64
    • 3
    • 7792

    Description

      An open file with no links reports link count 1, even 1 hour after the unlink(). I believe the issue is that the PENDING link is being erroneously reported to the client.

      # cd /mnt/lustre
      # ls -a
      .  ..  .lustre
      # touch FILE
      # stat FILE
        File: `FILE'
        Size: 0               Blocks: 0          IO Block: 2097152 regular empty file
      Device: 2c54f966h/743766374d    Inode: 144115205255725057  Links: 1
      Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
      Access: 2012-06-20 12:51:48.000000000 -0500
      Modify: 2012-06-20 12:51:48.000000000 -0500
      Change: 2012-06-20 12:51:48.000000000 -0500
      # exec 3<FILE
      # stat -L /proc/self/fd/3
        File: `/proc/self/fd/3'
        Size: 0               Blocks: 0          IO Block: 2097152 regular empty file
      Device: 2c54f966h/743766374d    Inode: 144115205255725057  Links: 1
      Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
      Access: 2012-06-20 12:51:48.000000000 -0500
      Modify: 2012-06-20 12:51:48.000000000 -0500
      Change: 2012-06-20 12:51:48.000000000 -0500
      # rm FILE
      # stat -L /proc/self/fd/3
        File: `/proc/self/fd/3'
        Size: 0               Blocks: 0          IO Block: 2097152 regular empty file
      Device: 2c54f966h/743766374d    Inode: 144115205255725057  Links: 1
      Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
      Access: 2012-06-20 12:51:48.000000000 -0500
      Modify: 2012-06-20 12:51:48.000000000 -0500
      Change: 2012-06-20 12:52:33.000000000 -0500
      # lsof /mnt/lustre
      COMMAND   PID USER   FD   TYPE      DEVICE SIZE/OFF               NODE NAME
      bash     5579 root  cwd    DIR 1273,181606     4096              25003 /mnt/lustre
      bash     5579 root    3r   REG 1273,181606        0 144115205255725057 /mnt/lustre/FILE (deleted)
      lsof    10806 root  cwd    DIR 1273,181606     4096              25003 /mnt/lustre
      lsof    10807 root  cwd    DIR 1273,181606     4096              25003 /mnt/lustre
      # sleep 3600
      # stat -L /proc/self/fd/3
        File: `/proc/self/fd/3'
        Size: 0               Blocks: 0          IO Block: 2097152 regular empty file
      Device: 2c54f966h/743766374d    Inode: 144115205255725057  Links: 1
      Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
      Access: 2012-06-20 12:51:48.000000000 -0500
      Modify: 2012-06-20 12:51:48.000000000 -0500
      Change: 2012-06-20 12:52:33.000000000 -0500
      

      Attachments

        Activity

          People

            bobijam Zhenyu Xu
            jhammond John Hammond
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: