diff options
author | Andi Kleen <andi@firstfloor.org> | 2008-06-27 05:05:24 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2008-07-02 17:06:27 -0400 |
commit | 9465efc9e96135a2cec8154c0c766fa59984a298 (patch) | |
tree | 079b94123ab65ff80c4869bcf25192c8596b049c /fs/nfs/file.c | |
parent | 9c20616c385ebeaa30257ef5d35e8f346db4ee32 (diff) |
Remove BKL from remote_llseek v2
- Replace remote_llseek with generic_file_llseek_unlocked (to force compilation
failures in all users)
- Change all users to either use generic_file_llseek_unlocked directly or
take the BKL around. I changed the file systems who don't use the BKL
for anything (CIFS, GFS) to call it directly. NCPFS and SMBFS and NFS
take the BKL, but explicitely in their own source now.
I moved them all over in a single patch to avoid unbisectable sections.
Open problem: 32bit kernels can corrupt fpos because its modification
is not atomic, but they can do that anyways because there's other paths who
modify it without BKL.
Do we need a special lock for the pos/f_version = 0 checks?
Trond says the NFS BKL is likely not needed, but keep it for now
until his full audit.
v2: Use generic_file_llseek_unlocked instead of remote_llseek_unlocked
and factor duplicated code (suggested by hch)
Cc: Trond.Myklebust@netapp.com
Cc: swhiteho@redhat.com
Cc: sfrench@samba.org
Cc: vandrove@vc.cvut.cz
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'fs/nfs/file.c')
-rw-r--r-- | fs/nfs/file.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 3536b01164f9..a34eb78989f5 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -170,6 +170,7 @@ force_reval: | |||
170 | 170 | ||
171 | static loff_t nfs_file_llseek(struct file *filp, loff_t offset, int origin) | 171 | static loff_t nfs_file_llseek(struct file *filp, loff_t offset, int origin) |
172 | { | 172 | { |
173 | loff_t loff; | ||
173 | /* origin == SEEK_END => we must revalidate the cached file length */ | 174 | /* origin == SEEK_END => we must revalidate the cached file length */ |
174 | if (origin == SEEK_END) { | 175 | if (origin == SEEK_END) { |
175 | struct inode *inode = filp->f_mapping->host; | 176 | struct inode *inode = filp->f_mapping->host; |
@@ -177,7 +178,10 @@ static loff_t nfs_file_llseek(struct file *filp, loff_t offset, int origin) | |||
177 | if (retval < 0) | 178 | if (retval < 0) |
178 | return (loff_t)retval; | 179 | return (loff_t)retval; |
179 | } | 180 | } |
180 | return remote_llseek(filp, offset, origin); | 181 | lock_kernel(); /* BKL needed? */ |
182 | loff = generic_file_llseek_unlocked(filp, offset, origin); | ||
183 | unlock_kernel(); | ||
184 | return loff; | ||
181 | } | 185 | } |
182 | 186 | ||
183 | /* | 187 | /* |