aboutsummaryrefslogtreecommitdiffstats
path: root/fs/locks.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/locks.c')
-rw-r--r--fs/locks.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/locks.c b/fs/locks.c
index ce93b416b490..22c5b4aa4961 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -1609,6 +1609,7 @@ int fcntl_getlease(struct file *filp)
1609 1609
1610 ctx = smp_load_acquire(&inode->i_flctx); 1610 ctx = smp_load_acquire(&inode->i_flctx);
1611 if (ctx && !list_empty_careful(&ctx->flc_lease)) { 1611 if (ctx && !list_empty_careful(&ctx->flc_lease)) {
1612 percpu_down_read_preempt_disable(&file_rwsem);
1612 spin_lock(&ctx->flc_lock); 1613 spin_lock(&ctx->flc_lock);
1613 time_out_leases(inode, &dispose); 1614 time_out_leases(inode, &dispose);
1614 list_for_each_entry(fl, &ctx->flc_lease, fl_list) { 1615 list_for_each_entry(fl, &ctx->flc_lease, fl_list) {
@@ -1618,6 +1619,8 @@ int fcntl_getlease(struct file *filp)
1618 break; 1619 break;
1619 } 1620 }
1620 spin_unlock(&ctx->flc_lock); 1621 spin_unlock(&ctx->flc_lock);
1622 percpu_up_read_preempt_enable(&file_rwsem);
1623
1621 locks_dispose_list(&dispose); 1624 locks_dispose_list(&dispose);
1622 } 1625 }
1623 return type; 1626 return type;
@@ -2529,11 +2532,14 @@ locks_remove_lease(struct file *filp, struct file_lock_context *ctx)
2529 if (list_empty(&ctx->flc_lease)) 2532 if (list_empty(&ctx->flc_lease))
2530 return; 2533 return;
2531 2534
2535 percpu_down_read_preempt_disable(&file_rwsem);
2532 spin_lock(&ctx->flc_lock); 2536 spin_lock(&ctx->flc_lock);
2533 list_for_each_entry_safe(fl, tmp, &ctx->flc_lease, fl_list) 2537 list_for_each_entry_safe(fl, tmp, &ctx->flc_lease, fl_list)
2534 if (filp == fl->fl_file) 2538 if (filp == fl->fl_file)
2535 lease_modify(fl, F_UNLCK, &dispose); 2539 lease_modify(fl, F_UNLCK, &dispose);
2536 spin_unlock(&ctx->flc_lock); 2540 spin_unlock(&ctx->flc_lock);
2541 percpu_up_read_preempt_enable(&file_rwsem);
2542
2537 locks_dispose_list(&dispose); 2543 locks_dispose_list(&dispose);
2538} 2544}
2539 2545