[LU-287] race in glimpse size Created: 06/May/11  Updated: 19/Aug/11  Resolved: 13/Jun/11

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 1.8.6
Fix Version/s: Lustre 1.8.6

Type: Bug Priority: Minor
Reporter: Niu Yawei (Inactive) Assignee: Niu Yawei (Inactive)
Resolution: Won't Fix Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 10333

 Description   

It looks to me there is a race in the size glimpse:

When a client received glimpse callback, it get the lock by ldlm_handle2lock_ns() in ldlm_callback_handler(), and just before calling the ll_glimpse_callback(), this lock is happen to be canceled locally, and the kms is shrinked on cancel, then ll_glimpse_callback() will tell server a wrong size (less than actual size).

Actually, we already have a flag (i.e. LDLM_FL_KMS_IGNORE) to notify that kms is being updated because the lock is being cancelled. We could just check for this flag in ll_glimpse_callback()and return EINVAL to the glimpse. The server should then update the LVB from disk and get the right object size since kms is updated on the client once all dirty data has been pushed to the server already.



 Comments   
Comment by Jinshan Xiong (Inactive) [ 06/May/11 ]

I tend to think this should be a safe race because anyway ldlm_server_glimpse_ast() will update lvb size by calling filter_lvbo_update() with @increase_only setting to 1. That means at the end of filter_intent_policy() the uptodate size will be returned to client eventually. Am I missed anything?

Comment by Niu Yawei (Inactive) [ 06/May/11 ]

Hi, Xiong

In such race, glimpse callback will success and the wrong size (less than actual size) will be sent back to server, and on server, ldlm_server_glimpse_ast() calls ldlm_res_lvbo_update(res, req, 1) to update LVB by this wrong size. Please note that the inode size on server hasn't been updated to LVB yet.

Comment by Niu Yawei (Inactive) [ 31/May/11 ]

2.x (master code) doesn't have this race, because the kms is always shrinked after ldlm_lock->l_ast_data detached.

Comment by Peter Jones [ 13/Jun/11 ]

As per last comment, not an issue

Comment by Niu Yawei (Inactive) [ 13/Jun/11 ]

It's not an issue for 2.x, the patch for b1_8 is at http://review.whamcloud.com/#change,512 . It's not landed yet.

Comment by Cory Spitz [ 19/Aug/11 ]

Is http://review.whamcloud.com/#change,512 intended to land on b1_8?

Generated at Sat Feb 10 01:05:34 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.