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

EOPNOTSUPP, ENOTSUPP, ENOTSUP confusion

Details

    • 3
    • 9223372036854775807

    Description

      llmv tries posix_fallocate() and falls back to ftruncate() if it indicates that the operation is not supported. From llvm-project-llvmorg-11.0.0/llvm/lib/Support/Unix/Path.inc:

      std::error_code resize_file(int FD, uint64_t Size) {
      #if defined(HAVE_POSIX_FALLOCATE)
        // If we have posix_fallocate use it. Unlike ftruncate it always allocates                                            
        // space, so we get an error if the disk is full.                                                                     
        if (int Err = ::posix_fallocate(FD, 0, Size)) {
      #ifdef _AIX
          constexpr int NotSupportedError = ENOTSUP;
      #else
          constexpr int NotSupportedError = EOPNOTSUPP;
      #endif
          if (Err != EINVAL && Err != NotSupportedError)
            return std::error_code(Err, std::generic_category());
        }
      #endif
        // Use ftruncate as a fallback. It may or may not allocate space. At least on                                         
        // OS X with HFS+ it does.                                                                                            
        if (::ftruncate(FD, Size) == -1)
          return std::error_code(errno, std::generic_category());
      
        return std::error_code();
      }
      

      Somewhere on the server side OST_FALLOCATE is failing and we are returning ENOTSUPP but we should be returning EOPNOTSUPP.

      Note:

      ENOTSUPP is 524 and defined only in the kernel errno.h and is a NFSv3 specific errno.

      EOPNOTSUPP (95) is defined in kernel and userspace errno.h.

      ENOTSUP is defined in userspace errno.h as an alias for EOPNOTSUPP.

      Ideally we should change every ENOTSUPP to EOPNOTSUPP and add a checkpatch warning. (Or almost every if there's some real NFSv3 interaction.)

      Attachments

        Activity

          [LU-14301] EOPNOTSUPP, ENOTSUPP, ENOTSUP confusion

          "Gian-Carlo DeFazio <defazio1@llnl.gov>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/60180
          Subject: LU-14301 client: use EOPNOTSUPP instead of ENOTSUPP
          Project: fs/lustre-release
          Branch: b2_15
          Current Patch Set: 1
          Commit: 7963a96264ed9efeabd471bb89a4e5556fe0f101

          gerrit Gerrit Updater added a comment - "Gian-Carlo DeFazio <defazio1@llnl.gov>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/60180 Subject: LU-14301 client: use EOPNOTSUPP instead of ENOTSUPP Project: fs/lustre-release Branch: b2_15 Current Patch Set: 1 Commit: 7963a96264ed9efeabd471bb89a4e5556fe0f101

          "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/51511/
          Subject: LU-14301 client: use EOPNOTSUPP instead of ENOTSUPP
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: ffd2fc1e17822c013d7790cc8247361c567792af

          gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/51511/ Subject: LU-14301 client: use EOPNOTSUPP instead of ENOTSUPP Project: fs/lustre-release Branch: master Current Patch Set: Commit: ffd2fc1e17822c013d7790cc8247361c567792af

          "Andreas Dilger <adilger@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51511
          Subject: LU-14301 client: use EOPNOTSUPP instead of ENOTSUPP
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: 1a0d553000d5a869f9039bab74dbdbb20d4259b0

          gerrit Gerrit Updater added a comment - "Andreas Dilger <adilger@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51511 Subject: LU-14301 client: use EOPNOTSUPP instead of ENOTSUPP Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 1a0d553000d5a869f9039bab74dbdbb20d4259b0

          Is there a back port to 2.12. ?

          mhanafi Mahmoud Hanafi added a comment - Is there a back port to 2.12. ?

          Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/41280/
          Subject: LU-14301 lustre: add ENOTSUPP to spelling.txt
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: e00733f0f87659c936039a58ea738cfb070638bc

          gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/41280/ Subject: LU-14301 lustre: add ENOTSUPP to spelling.txt Project: fs/lustre-release Branch: master Current Patch Set: Commit: e00733f0f87659c936039a58ea738cfb070638bc

          John L. Hammond (jhammond@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/41280
          Subject: LU-14301 lustre: add ENOTSUPP to spelling.txt
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: b161a8606b589da824c60702ac35e758ce45c9ca

          gerrit Gerrit Updater added a comment - John L. Hammond (jhammond@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/41280 Subject: LU-14301 lustre: add ENOTSUPP to spelling.txt Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: b161a8606b589da824c60702ac35e758ce45c9ca
          pjones Peter Jones added a comment -

          Landed for 2.14

          pjones Peter Jones added a comment - Landed for 2.14

          Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/41148/
          Subject: LU-14301 llite: return EOPNOTSUPP if fallocate is not supported
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: 71a9f5a466bfa46436535e3173d1fed37ca12aea

          gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/41148/ Subject: LU-14301 llite: return EOPNOTSUPP if fallocate is not supported Project: fs/lustre-release Branch: master Current Patch Set: Commit: 71a9f5a466bfa46436535e3173d1fed37ca12aea

          John L. Hammond (jhammond@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/41148
          Subject: LU-14301 llite: return EOPNOTSUPP if fallocate is not supported
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: 51216ee83e1bc036e9e7bd19ede536d98cffb244

          gerrit Gerrit Updater added a comment - John L. Hammond (jhammond@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/41148 Subject: LU-14301 llite: return EOPNOTSUPP if fallocate is not supported Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 51216ee83e1bc036e9e7bd19ede536d98cffb244

          People

            jhammond John Hammond
            jhammond John Hammond
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: