lockd: handle fl_notify callbacks
Review
Quoted 2 lines · J. Bruce Fields
(quoted diff) +2
-0+ if (block->b_fl) + kfree(block->b_fl);
kfree(NULL) is fine.
Quoted 5 lines
(quoted diff) +5
-0+static void +nlmsvc_update_deferred_block(struct nlm_block *block, struct file_lock *conf, + int result) +{ + block->b_flags |= B_GOT_CALLBACK;
Review
Quoted 10 lines
(quoted diff) +10
-0+ if (result == 0) + block->b_granted = 1; + else + block->b_flags |= B_TOO_LATE; + if (conf) { + block->b_fl = kzalloc(sizeof(struct file_lock), GFP_KERNEL); + if (block->b_fl) + locks_copy_lock(block->b_fl, conf); + } +}
Shouldn't there be a way to propagate errors back to the caller when the kzalloc fails?
Quoted 5 lines · Christoph Hellwig
Review
Quoted 2 lines · J. Bruce Fields
(quoted diff) +2
-0+ if (block->b_fl) + kfree(block->b_fl);kfree(NULL) is fine.
Whoops, thanks, will fix.
Quoted 10 lines
Quoted 10 lines
(quoted diff) +10
-0+static void +nlmsvc_update_deferred_block(struct nlm_block *block, struct file_lock *conf, + int result) +{ + block->b_flags |= B_GOT_CALLBACK; + if (result == 0) + block->b_granted = 1; + else + block->b_flags |= B_TOO_LATE; + if (conf) {
Quoted 8 lines
Review
Quoted 5 lines
(quoted diff) +5
-0+ block->b_fl = kzalloc(sizeof(struct file_lock), GFP_KERNEL); + if (block->b_fl) + locks_copy_lock(block->b_fl, conf); + } +}Shouldn't there be a way to propagate errors back to the caller when the kzalloc fails?
That's fixed in a later patch, so there may be a problem with how I split up those patches--I'll check.
--b.