--- fs/sync.c
+++ fs/sync.c
@@ -143,6 +143,10 @@ SYSCALL_DEFINE1(syncfs, int, fd)
int ret;
int fput_needed;
+#ifdef CONFIG_DYNAMIC_FSYNC
+ if (!early_suspend_active)
+ return 0;
+#endif
file = fget_light(fd, &fput_needed);
if (!file)
return -EBADF;
@@ -221,11 +225,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;
}
@@ -260,6 +265,10 @@ SYSCALL_DEFINE1(fdatasync, unsigned int,
*/
int generic_write_sync(struct file *file, loff_t pos, loff_t count)
{
+#ifdef CONFIG_DYNAMIC_FSYNC
+ if (!early_suspend_active)
+ return 0;
+#endif
if (!(file->f_flags & O_DSYNC) && !IS_SYNC(file->f_mapping->host))
return 0;
return vfs_fsync_range(file, pos, pos + count - 1,