From patchwork Wed Dec 9 22:00:38 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Engelhardt X-Patchwork-Id: 66097 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nB9M0gok017776 for ; Wed, 9 Dec 2009 22:00:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757365AbZLIWAd (ORCPT ); Wed, 9 Dec 2009 17:00:33 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757304AbZLIWAd (ORCPT ); Wed, 9 Dec 2009 17:00:33 -0500 Received: from borg.medozas.de ([188.40.89.202]:45433 "EHLO borg.medozas.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757300AbZLIWAd (ORCPT ); Wed, 9 Dec 2009 17:00:33 -0500 Received: by borg.medozas.de (Postfix, from userid 25121) id DD622F0C342D3; Wed, 9 Dec 2009 23:00:38 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by borg.medozas.de (Postfix) with ESMTP id D273C7A61; Wed, 9 Dec 2009 23:00:38 +0100 (CET) Date: Wed, 9 Dec 2009 23:00:38 +0100 (CET) From: Jan Engelhardt To: cmason@oracle.com cc: linux-btrfs@vger.kernel.org Subject: btrfs: fix missing last-entry in readdir(3) Message-ID: User-Agent: Alpine 2.01 (LSU 1266 2009-07-14) MIME-Version: 1.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index b3ad168..7bf9811 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -3869,7 +3869,11 @@ skip: /* Reached end of directory/root. Bump pos past the last item. */ if (key_type == BTRFS_DIR_INDEX_KEY) - filp->f_pos = INT_LIMIT(off_t); + /* + * 32-bit glibc will use getdents64, but then strtol - + * so the last number we can serve is this. + */ + filp->f_pos = 0x7fffffff; else filp->f_pos++; nopos: