]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/WBThrottle: added check of return value for posix_fadvise()
authorXing Lin <xinglin@cs.utah.edu>
Thu, 28 Nov 2013 06:30:15 +0000 (23:30 -0700)
committerXing Lin <xinglin@cs.utah.edu>
Tue, 3 Dec 2013 18:19:13 +0000 (11:19 -0700)
check the return value of posix_fadvise() in WBThrottle::entry()

Signed-off-by: Xing Lin <xinglin@cs.utah.edu>
src/os/WBThrottle.cc

index 9430c4fd3cde425075d3c0e5e04901bf8572ad0c..d71583958c658dbe1838cea77e53ad0fc4b37f30 100644 (file)
@@ -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();