diff options
author | J. Bruce Fields <bfields@redhat.com> | 2011-09-20 17:19:26 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-11-09 00:16:44 -0500 |
commit | 27ac0ffeac80ba6b9580529568d06144df044366 (patch) | |
tree | a2e523716039784271250387d6e94ec4f01daec5 /fs/utimes.c | |
parent | 146a8595c6399ee6ab4b5cc34c0d28aa4835fdc5 (diff) |
locks: break delegations on any attribute modification
NFSv4 uses leases to guarantee that clients can cache metadata as well
as data.
Cc: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
Cc: David Howells <dhowells@redhat.com>
Cc: Tyler Hicks <tyhicks@canonical.com>
Cc: Dustin Kirkland <dustin.kirkland@gazzang.com>
Acked-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/utimes.c')
-rw-r--r-- | fs/utimes.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/utimes.c b/fs/utimes.c index f4fb7eca10e8..aa138d64560a 100644 --- a/fs/utimes.c +++ b/fs/utimes.c | |||
@@ -53,6 +53,7 @@ static int utimes_common(struct path *path, struct timespec *times) | |||
53 | int error; | 53 | int error; |
54 | struct iattr newattrs; | 54 | struct iattr newattrs; |
55 | struct inode *inode = path->dentry->d_inode; | 55 | struct inode *inode = path->dentry->d_inode; |
56 | struct inode *delegated_inode = NULL; | ||
56 | 57 | ||
57 | error = mnt_want_write(path->mnt); | 58 | error = mnt_want_write(path->mnt); |
58 | if (error) | 59 | if (error) |
@@ -101,9 +102,15 @@ static int utimes_common(struct path *path, struct timespec *times) | |||
101 | goto mnt_drop_write_and_out; | 102 | goto mnt_drop_write_and_out; |
102 | } | 103 | } |
103 | } | 104 | } |
105 | retry_deleg: | ||
104 | mutex_lock(&inode->i_mutex); | 106 | mutex_lock(&inode->i_mutex); |
105 | error = notify_change(path->dentry, &newattrs); | 107 | error = notify_change(path->dentry, &newattrs, &delegated_inode); |
106 | mutex_unlock(&inode->i_mutex); | 108 | mutex_unlock(&inode->i_mutex); |
109 | if (delegated_inode) { | ||
110 | error = break_deleg_wait(&delegated_inode); | ||
111 | if (!error) | ||
112 | goto retry_deleg; | ||
113 | } | ||
107 | 114 | ||
108 | mnt_drop_write_and_out: | 115 | mnt_drop_write_and_out: |
109 | mnt_drop_write(path->mnt); | 116 | mnt_drop_write(path->mnt); |