Details

    • Technical task
    • Resolution: Fixed
    • Blocker
    • Lustre 2.5.0
    • Lustre 2.5.0
    • 10028

    Description

      HSM release in not preserving block count as reported by stat()

      # cd /mnt/lustre
      # dd if=/dev/zero of=Antoshka bs=1M count=10
      10+0 records in
      10+0 records out
      10485760 bytes (10 MB) copied, 0.0740321 s, 142 MB/s
      # stat Antoshka 
        File: `Antoshka'
        Size: 10485760  	Blocks: 20480      IO Block: 4194304 regular file
      Device: 2c54f966h/743766374d	Inode: 144115205255725060  Links: 1
      Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
      Access: 2013-08-30 10:13:48.000000000 -0500
      Modify: 2013-08-30 10:13:48.000000000 -0500
      Change: 2013-08-30 10:13:48.000000000 -0500
      # lfs hsm_archive Antoshka 
      # lfs hsm_release Antoshka
      # stat Antoshka
        File: `Antoshka'
        Size: 10485760  	Blocks: 0          IO Block: 4194304 regular file
      Device: 2c54f966h/743766374d	Inode: 144115205255725060  Links: 1
      Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
      Access: 2013-08-30 10:13:48.000000000 -0500
      Modify: 2013-08-30 10:13:48.000000000 -0500
      Change: 2013-08-30 10:13:48.000000000 -0500
      

      I had intended to fix this with LU-3811 but it will require some work in the MD* attr_set patch.

      If you're thinking (philosophically) hmm, well maybe it should report a block count of 0 here then you're just wrong.

      Attachments

        Activity

          [LU-3864] stat() on HSM released file returns st_blocks = 0
          pjones Peter Jones added a comment -

          Landed for LU-3864

          pjones Peter Jones added a comment - Landed for LU-3864
          bfaccini Bruno Faccini (Inactive) added a comment - http://review.whamcloud.com/7776 has land and http://review.whamcloud.com/7584 only misses reviews now.
          bfaccini Bruno Faccini (Inactive) added a comment - - edited

          Submitted patch to have st_blocks = 1 returned for released files, at http://review.whamcloud.com/7776

          bfaccini Bruno Faccini (Inactive) added a comment - - edited Submitted patch to have st_blocks = 1 returned for released files, at http://review.whamcloud.com/7776

          Most of filesystem does not count the space used by inode (unless there is extra block used by metadata, like for EA) when filling st_blocks, but POSIX does not say if it is only data or not.

          Anyway, I think we will have to go for the "st_blocks == 1" solution.

          I checked what XFS/DMF does for that. SGI says "don't use tar".... :/

          adegremont Aurelien Degremont (Inactive) added a comment - Most of filesystem does not count the space used by inode (unless there is extra block used by metadata, like for EA) when filling st_blocks, but POSIX does not say if it is only data or not. Anyway, I think we will have to go for the "st_blocks == 1" solution. I checked what XFS/DMF does for that. SGI says "don't use tar".... :/

          Note that returning st_blocks = 1 can still be justified as "correct" for HSM released files, since this is still consuming one sector on the MDT filesystem for the inode.

          adilger Andreas Dilger added a comment - Note that returning st_blocks = 1 can still be justified as "correct" for HSM released files, since this is still consuming one sector on the MDT filesystem for the inode.

          We already do the same on the client if it only has writeback cache pages - if st_blocks == 0 but there is dirty data in the client cache we return st_blocks = 1. See cl_glimpse_lock():

                                          if (cl_isize_read(inode) > 0 &&
                                              inode->i_blocks == 0) {
                                                  /*
                                                   * LU-417: Add dirty pages block count
                                                   * lest i_blocks reports 0, some "cp" or
                                                   * "tar" may think it's a completely
                                                   * sparse file and skip it.
                                                   */
                                                  inode->i_blocks = dirty_cnt(inode);
          
          adilger Andreas Dilger added a comment - We already do the same on the client if it only has writeback cache pages - if st_blocks == 0 but there is dirty data in the client cache we return st_blocks = 1. See cl_glimpse_lock(): if (cl_isize_read(inode) > 0 && inode->i_blocks == 0) { /* * LU-417: Add dirty pages block count * lest i_blocks reports 0, some "cp" or * "tar" may think it's a completely * sparse file and skip it. */ inode->i_blocks = dirty_cnt(inode);

          People

            bfaccini Bruno Faccini (Inactive)
            jhammond John Hammond
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: