From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752597AbbCTXd4 (ORCPT ); Fri, 20 Mar 2015 19:33:56 -0400 Received: from a.ns.miles-group.at ([95.130.255.143]:65277 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752573AbbCTXdv (ORCPT ); Fri, 20 Mar 2015 19:33:51 -0400 Message-ID: <550CAE5C.9010101@nod.at> Date: Sat, 21 Mar 2015 00:33:48 +0100 From: Richard Weinberger User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: shaggy@kernel.org CC: jfs-discussion@lists.sourceforge.net, linux-fsdevel , Al Viro , lists@nerdbynature.de, ben@decadent.org.uk, stable , hmage@hmage.net, "linux-kernel@vger.kernel.org" Subject: JFS readdir() issues in stable 3.2 Content-Type: multipart/mixed; boundary="------------080400020509040006080206" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a multi-part message in MIME format. --------------080400020509040006080206 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Hi! Mainline commit 44512449c0ab368889dd13ae0031fba74ee7e1d2 (jfs: fix readdir cookie incompatibility with NFSv4) does not work as expected on 3.2. Maybe on other stable kernels too. UML stumbled over it: https://bugzilla.kernel.org/show_bug.cgi?id=94741 If you run the attached readdir.c on a JFS on stable 3.2.51+ readdir() will not increment the directory offset nor return NULL, hence the caller will loop forever. It looks like if the current directory offset is > 0 and you run seekdir(telldir()) the next readdir() call will not increment it. Dave, has your fix some unnamed dependencies which need backporting too? Thanks, //richard --------------080400020509040006080206 Content-Type: text/x-csrc; name="readdir.c" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="readdir.c" #include #include #include int main(int argc, char *argv[]) { DIR *dirp; struct dirent *dent; off_t dpos; if (argc < 2) { fprintf(stderr, "Usage: %s DIR\n", argv[0]); return 1; } dirp =3D opendir(argv[1]); assert(dirp); dpos =3D 0; for (;;) { seekdir(dirp, dpos); dent =3D readdir(dirp); if (!dent) break; assert(dpos !=3D telldir(dirp)); dpos =3D telldir(dirp); } return 0; } --------------080400020509040006080206--