[PATCH 2/2] btrfs: Cleanup llseek()

2013-06-14 Thread Richard Yao
There are multiple issues with the custom llseek implemented in btrfs for implementing SEEK_HOLE/SEEK_DATA. 1. It takes the inode->i_mutex lock before calling generic_file_llseek(), which is unnecessary. 2. It fails to take the filp->f_lock spinlock before modifying filp->f_pos and

[PATCH 2/2] btrfs: Cleanup llseek()

2013-06-14 Thread Richard Yao
There are multiple issues with the custom llseek implemented in btrfs for implementing SEEK_HOLE/SEEK_DATA. 1. It takes the inode-i_mutex lock before calling generic_file_llseek(), which is unnecessary. 2. It fails to take the filp-f_lock spinlock before modifying filp-f_pos and filp-f_version,