From: Hongchao Zhang Date: Tue, 30 Nov 2021 10:11:01 +0000 (+0800) Subject: EX-4270 snapshot: avoid call quota op recursively X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=f29d42f4eb0e55c660590c71162541aac4fd8c01;p=fs%2Flustre-release.git EX-4270 snapshot: avoid call quota op recursively In ext4_snapshot_test_and_cow, if there is already in some quota call, it could cause deadlock if the snapshot calls quota function to allocate space recursively. [only the change to snapshot-jbd2-rhel7.7.patch] Lustre-change: https://review.whamcloud.com/45680 Lustre-commit: 4722f1a0ca9d24bf6fa2678659ccf2cb1be5cdf1 Test-Parameters: trivial Change-Id: Iac354744fcee8955d8e41020f9cee6d433f38e80 Signed-off-by: Hongchao Zhang Reviewed-by: Li Dongyang Reviewed-by: Andreas Dilger Reviewed-on: https://review.whamcloud.com/46009 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Li Xi --- diff --git a/lustre/kernel_patches/patches/snapshot-jbd2-rhel7.7.patch b/lustre/kernel_patches/patches/snapshot-jbd2-rhel7.7.patch index 5aad4f3..149fda4 100644 --- a/lustre/kernel_patches/patches/snapshot-jbd2-rhel7.7.patch +++ b/lustre/kernel_patches/patches/snapshot-jbd2-rhel7.7.patch @@ -1,7 +1,7 @@ diff -p -u linux-3.10.0-1127.8.2.el7.x86_64/include/linux/jbd2.h linux-3.10.0-1127.8.2.el7.x86_64.snapshot/include/linux/jbd2.h --- linux-3.10.0-1127.8.2.el7.x86_64/include/linux/jbd2.h 2020-07-10 19:21:51.385885376 +0800 +++ linux-3.10.0-1127.8.2.el7.x86_64.snapshot/include/linux/jbd2.h 2020-07-10 19:24:22.430382708 +0800 -@@ -448,6 +448,14 @@ struct jbd2_journal_handle +@@ -448,6 +448,15 @@ struct jbd2_journal_handle unsigned long h_start_jiffies; unsigned int h_requested_credits; @@ -11,7 +11,8 @@ diff -p -u linux-3.10.0-1127.8.2.el7.x86_64/include/linux/jbd2.h linux-3.10.0-11 + /* Number of buffers the user is allowed to dirty: + * (counts only buffers dirtied when !h_cowing) */ + unsigned int h_user_credits:14; -+ unsigned int h_cowing:1; /* COWing block to snapshot */ ++ unsigned int h_cowing:1, /* COWing block to snapshot */ ++ h_in_quota:1; /* in quota call path */ + #ifdef CONFIG_DEBUG_LOCK_ALLOC struct lockdep_map h_lockdep_map;