diff options
author | Dinu-Razvan Chis-Serban <justcsdr@gmail.com> | 2018-09-05 10:44:12 +0300 |
---|---|---|
committer | Dominique Martinet <dominique.martinet@cea.fr> | 2018-09-07 19:40:06 +0300 |
commit | 5e172f75e51e3de1b4274146d9b990f803cb5c2a (patch) | |
tree | 046d1464c0dfee806b4db9d0e4cbf1929cd997ad /fs/9p/vfs_file.c | |
parent | 2803cf4379ed252894f046cb8812a48db35294e3 (diff) | |
download | linux-5e172f75e51e3de1b4274146d9b990f803cb5c2a.tar.xz |
9p locks: add mount option for lock retry interval
The default P9_LOCK_TIMEOUT can be too long for some users exporting
a local file system to a guest VM (30s), make this configurable at
mount time.
Link: http://lkml.kernel.org/r/1536295827-3181-1-git-send-email-asmadeus@codewreck.org
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=195727
Signed-off-by: Dinu-Razvan Chis-Serban <justcsdr@gmail.com>
Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
Diffstat (limited to 'fs/9p/vfs_file.c')
-rw-r--r-- | fs/9p/vfs_file.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index 374bc1c72048..73857ebaedfb 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c @@ -154,6 +154,7 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl) uint8_t status = P9_LOCK_ERROR; int res = 0; unsigned char fl_type; + struct v9fs_session_info *v9ses; fid = filp->private_data; BUG_ON(fid == NULL); @@ -189,6 +190,8 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl) if (IS_SETLKW(cmd)) flock.flags = P9_LOCK_FLAGS_BLOCK; + v9ses = v9fs_inode2v9ses(file_inode(filp)); + /* * if its a blocked request and we get P9_LOCK_BLOCKED as the status * for lock request, keep on trying @@ -202,7 +205,8 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl) break; if (status == P9_LOCK_BLOCKED && !IS_SETLKW(cmd)) break; - if (schedule_timeout_interruptible(P9_LOCK_TIMEOUT) != 0) + if (schedule_timeout_interruptible(v9ses->session_lock_timeout) + != 0) break; } |