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

lli_trunc_sem can lead to a readlock

Details

    • Bug
    • Resolution: Fixed
    • Major
    • Lustre 2.14.0
    • Lustre 2.13.0, Lustre 2.12.2
    • None
    • Any lustre client
    • 3
    • 9223372036854775807

    Description

      Neil Brown discovered during the linux lustre client work a potential read lock condition involving lli_trunc_sem. If you mmap a lustre file, then read into that mapped memory from the file they can shared the same mmap_sem which does is okay since they are down_read() calls. The read lock can happen if truncate is called in between memory mapping the file and reading into the that mapped memory from the file.

      Attachments

        Issue Links

          Activity

            [LU-12460] lli_trunc_sem can lead to a readlock
            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/35271/
            Subject: LU-12460 llite: replace lli_trunc_sem
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: e5914a61ac7705f5768c9c75094a456dafefb04f

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/35271/ Subject: LU-12460 llite: replace lli_trunc_sem Project: fs/lustre-release Branch: master Current Patch Set: Commit: e5914a61ac7705f5768c9c75094a456dafefb04f

            Right, thank you - Obviously, I did not read through the full series......

            pfarrell Patrick Farrell (Inactive) added a comment - Right, thank you - Obviously, I did not read through the full series......
            neilb Neil Brown added a comment -

            Patrick,

             that patch has been in my lustre-testing branch for a while, but I hadn't posted it because I really want there to be a better way - so I was procrastinating.

            James did post it to the list on 20th May with a bunch of patches which were patches from my lustre-testing which he had modified to varying extents (I've merged the changes I liked into my lustre-testing).

            You might  remember discussing your "ll_fault fixes" patch that was in the series and I had questions about it.  It was patch 1 of the series.  This patch was patch  3 (of 29).

            neilb Neil Brown added a comment - Patrick,  that patch has been in my lustre-testing branch for a while, but I hadn't posted it because I really want there to be a better way - so I was procrastinating. James did post it to the list on 20th May with a bunch of patches which were patches from my lustre-testing which he had modified to varying extents (I've merged the changes I liked into my lustre-testing). You might  remember discussing your "ll_fault fixes" patch that was in the series and I had questions about it.  It was patch 1 of the series.  This patch was patch  3 (of 29).

            Patrick Farrell (pfarrell@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/35283
            Subject: LU-12460 llite: replace lli_trunc_sem
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: e0561ca36a6062d423a447070eda688d0194b2cf

            gerrit Gerrit Updater added a comment - Patrick Farrell (pfarrell@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/35283 Subject: LU-12460 llite: replace lli_trunc_sem Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: e0561ca36a6062d423a447070eda688d0194b2cf

            James,

            I asked this in Gerrit but didn't see a response - Has this patch been on a mailing list and I missed it?  Or is this the first appearance of it?  If it's been on a mailing list, which one?

            pfarrell Patrick Farrell (Inactive) added a comment - James, I asked this in Gerrit but didn't see a response - Has this patch been on a mailing list and I missed it?  Or is this the first appearance of it?  If it's been on a mailing list, which one?

            Yeah the details were lacking at the time I opened the ticket. It was based on what was in the patch. As the discussion continues this ticket description can be updated.

            simmonsja James A Simmons added a comment - Yeah the details were lacking at the time I opened the ticket. It was based on what was in the patch. As the discussion continues this ticket description can be updated.

            James, your bug description doesn't quite make sense. Is there supposed to be a write lock somewhere in there?

            I haven't looked at the CLIO code in a while, but we used to have a check for the source pages coming from mmapped memory of the target file, or vice versa.

            adilger Andreas Dilger added a comment - James, your bug description doesn't quite make sense. Is there supposed to be a write lock somewhere in there? I haven't looked at the CLIO code in a while, but we used to have a check for the source pages coming from mmapped memory of the target file, or vice versa.

            James Simmons (uja.ornl@yahoo.com) uploaded a new patch: https://review.whamcloud.com/35271
            Subject: LU-12460 llite: replace lli_trunc_sem
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: a234469c691056b1eb81ae0a22ab9f105cffa8a9

            gerrit Gerrit Updater added a comment - James Simmons (uja.ornl@yahoo.com) uploaded a new patch: https://review.whamcloud.com/35271 Subject: LU-12460 llite: replace lli_trunc_sem Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: a234469c691056b1eb81ae0a22ab9f105cffa8a9

            People

              neilb Neil Brown
              simmonsja James A Simmons
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: