From: Xing Lin Date: Thu, 28 Nov 2013 06:30:15 +0000 (-0700) Subject: os/WBThrottle: added check of return value for posix_fadvise() X-Git-Tag: v0.74~36^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9c8df34919af8a6ecd74cbc3abf71440c6a3c752;p=ceph.git os/WBThrottle: added check of return value for posix_fadvise() check the return value of posix_fadvise() in WBThrottle::entry() Signed-off-by: Xing Lin --- diff --git a/src/os/WBThrottle.cc b/src/os/WBThrottle.cc index 9430c4fd3cde..d71583958c65 100644 --- a/src/os/WBThrottle.cc +++ b/src/os/WBThrottle.cc @@ -149,8 +149,10 @@ void *WBThrottle::entry() lock.Unlock(); ::fdatasync(**wb.get<1>()); #ifdef HAVE_POSIX_FADVISE - if (wb.get<2>().nocache) - posix_fadvise(**wb.get<1>(), 0, 0, POSIX_FADV_DONTNEED); + if (wb.get<2>().nocache) { + int fa_r = posix_fadvise(**wb.get<1>(), 0, 0, POSIX_FADV_DONTNEED); + assert(fa_r == 0); + } #endif lock.Lock(); clearing = ghobject_t();