X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=fs%2Fsync.c;h=d104591b066bf474f62f665e87e04154c4da5da1;hb=066b3aa8454bee3cdc665d86b5de812d8d0513b3;hp=192340930bb477f506eeee2eb132db06a1a6309f;hpb=2daea67e966dc0c42067ebea015ddac6834cef88;p=safe%2Fjmp%2Flinux-2.6 diff --git a/fs/sync.c b/fs/sync.c index 1923409..d104591 100644 --- a/fs/sync.c +++ b/fs/sync.c @@ -27,6 +27,13 @@ */ static int __sync_filesystem(struct super_block *sb, int wait) { + /* + * This should be safe, as we require bdi backing to actually + * write out data in the first place + */ + if (!sb->s_bdi) + return 0; + /* Avoid doing twice syncing and cache pruning for quota sync */ if (!wait) { writeout_quota_sb(sb, -1); @@ -101,7 +108,7 @@ restart: spin_unlock(&sb_lock); down_read(&sb->s_umount); - if (!(sb->s_flags & MS_RDONLY) && sb->s_root) + if (!(sb->s_flags & MS_RDONLY) && sb->s_root && sb->s_bdi) __sync_filesystem(sb, wait); up_read(&sb->s_umount); @@ -176,6 +183,7 @@ int file_fsync(struct file *filp, struct dentry *dentry, int datasync) ret = err; return ret; } +EXPORT_SYMBOL(file_fsync); /** * vfs_fsync_range - helper to sync a range of data & metadata to disk