--- a/fs/sync.c
+++ b/fs/sync.c
@@ -221,11 +221,12 @@ static int do_fsync(unsigned int fd, int
{
struct file *file;
int ret = -EBADF;
+ int fput_needed;
- file = fget(fd);
+ file = fget_light(fd, &fput_needed);
if (file) {
ret = vfs_fsync(file, datasync);
- fput(file);
+ fput_light(file, fput_needed);
}
return ret;
}