eCryptfs: fix possible fault in ecryptfs_sync_page

This will avoid a possible fault in ecryptfs_sync_page().

In the function, eCryptfs calls sync_page() method of a lower filesystem
without checking its existence. However, there are many filesystems that
don't have this method including network filesystems such as NFS, AFS, and
so forth. They may fail when an eCryptfs page is waiting for lock.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Acked-by: Michael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Ryusuke Konishi and committed by Linus Torvalds 2aeb3db1 85787a2b

+2 -1
+2 -1
fs/ecryptfs/mmap.c
··· 834 834 ecryptfs_printk(KERN_DEBUG, "find_lock_page failed\n"); 835 835 return; 836 836 } 837 - lower_page->mapping->a_ops->sync_page(lower_page); 837 + if (lower_page->mapping->a_ops->sync_page) 838 + lower_page->mapping->a_ops->sync_page(lower_page); 838 839 ecryptfs_printk(KERN_DEBUG, "Unlocking page with index = [0x%.16x]\n", 839 840 lower_page->index); 840 841 unlock_page(lower_page);