Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
[firefly-linux-kernel-4.4.55.git] / fs / xfs / xfs_trans_buf.c
index 3bea66132334c91e83278a5c581fae7d399e1490..03b3b7f85a3b59b68a1d6ff99ba83ac38ac7094c 100644 (file)
@@ -383,7 +383,8 @@ xfs_trans_read_buf(
        bp = xfs_buf_read(target, blkno, len, flags | XBF_DONT_BLOCK);
        if (bp == NULL) {
                *bpp = NULL;
-               return 0;
+               return (flags & XBF_TRYLOCK) ?
+                                       0 : XFS_ERROR(ENOMEM);
        }
        if (XFS_BUF_GETERROR(bp) != 0) {
            XFS_BUF_SUPER_STALE(bp);