scoutfs: add full lock coverage to _item_next*()

Add the full lock argument to _item_next*() so that it can verify lock
coverage in addition to limiting item cache population to the range
covered by the lock.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2017-10-09 15:31:29 -07:00
committed by Mark Fasheh
parent 0e4627ea65
commit 1c6e3e39bf
7 changed files with 27 additions and 22 deletions
+2 -2
View File
@@ -379,7 +379,7 @@ static int scoutfs_readdir(struct file *file, void *dirent, filldir_t filldir)
scoutfs_kvec_init(val, dent, item_len);
ret = scoutfs_item_next_same_min(sb, &key, &last_key, val,
offsetof(struct scoutfs_dirent, name[1]),
dir_lock->end);
dir_lock);
if (ret < 0) {
if (ret == -ENOENT)
ret = 0;
@@ -1080,7 +1080,7 @@ static int add_next_linkref(struct super_block *sb, u64 ino,
if (ret)
goto out;
ret = scoutfs_item_next(sb, &key, &last, NULL, lock->end);
ret = scoutfs_item_next(sb, &key, &last, NULL, lock);
scoutfs_unlock(sb, lock, DLM_LOCK_PR);
lock = NULL;