Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-116645

xfs: allow symlink creation to wait for or initiate release of preallocated file space when receiving ENOSPC trying to allocate a new directory block

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • rhel-9.6.z, rhel-10.0.z
    • None
    • No
    • Low
    • None
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • None

      What were you trying to do that didn't work?

      If the available disk space is insufficient to allocate a new directory block, but files are still holding preallocated space, creating a symlink will fail with ENOENT, rather than causing release 

      Creating a file or subdirectory under the same condition will cause release of the preallocated file space, so ENOENT only occurs when the disk is truly full.

      After a period of time, the preallocated space may be released, at which point creating a symlink will again succeed.

      What is the impact of this issue to you?

      Temporary inability to create symlinks when disk is nearly full.

       

      Please provide the package NVR for which the bug is seen:

      RHEL 10 kernels, RHEL 9 kernels

      How reproducible is this bug?:

      easy

      Steps to reproduce

      the attached program alternately 1) creates a file, writes to it, and closes it; and 2) creates a symlink to that file; if the symlink creation fails, delay briefly and reattempt symlink.

      The file write size is designed to result in preallocated space.

       

      1. dfd = open("mnt", O_RDONLY|O_DIRECTORY)
      2. i = 0
      3. sprintf(filename, "file%06d", i)
      4. fd = openat(dfd, filename, O_CREAT|O_TRUNC|O_RDWR, 0644)
      5. for (j = 0 ; j < 5 ; j++) { write(fd, buf, 64KiB) }
      6. close(fd)
      7. sprintf(linkname, "link%06d", i)
      8. while ((symlinkat(dfd, filename, dfd, linkname)) < 0) { ... usleep(); }
      9. i = i++

      Expected results

      both file and symlink creation succeed until full filesystem prevents allocation of a directory block; preallocated space is released if needed to satisfy the symlink creation

      Actual results

      symlink creation does not recover preallocated space, so symlinkat() fails temporarily, until preallocated space is released, then symlinkat succeeds again

       

       

              Unassigned Unassigned
              rhn-support-fsorenso Frank Sorenson
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated: