From owner-freebsd-hackers@FreeBSD.ORG Sat Mar 30 21:38:29 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 04207B2A for ; Sat, 30 Mar 2013 21:38:29 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-qa0-f44.google.com (mail-qa0-f44.google.com [209.85.216.44]) by mx1.freebsd.org (Postfix) with ESMTP id C1793D6D for ; Sat, 30 Mar 2013 21:38:28 +0000 (UTC) Received: by mail-qa0-f44.google.com with SMTP id o13so380521qaj.17 for ; Sat, 30 Mar 2013 14:38:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:date:x-google-sender-auth:message-id :subject:from:to:content-type; bh=rFc0J7gvrcr4RLhy/VDJa/kWvPvymsY7XqG+kW4X48w=; b=J/T/aaBjNr8M4GZApLPRvXgXLoDBlZMO542ht4F8et8w3Zukd2dBtu9IVPsdm11kvO 7g7vUS3Atv1OTncxsmOXUlph54V1EflHGXm84D3+HlIgtMGB6nfa8csT4i8aNMhze8If XdNGCUOBD5cLs9Gvk7VZEImR95lum6WFjlEVdnfvq87H5GESaQ894OdlLbYqakLeGukM 2MeU98EaW+twqb9BMYkqpJPg+C52oj00RONe0ByyR2fkpjaWMaf44PsHOwAqDKhlbErF X5BuEQzb7qZKm11KKhs0vHE5ZH7TYC7O4ujKpBHpsais9xRoJZvu1uRRZtQbm4rla0Pf eiPw== MIME-Version: 1.0 X-Received: by 10.229.149.211 with SMTP id u19mr3012363qcv.13.1364679021572; Sat, 30 Mar 2013 14:30:21 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.229.253.201 with HTTP; Sat, 30 Mar 2013 14:30:21 -0700 (PDT) Date: Sat, 30 Mar 2013 14:30:21 -0700 X-Google-Sender-Auth: P1t7k1LC81SCPH_sZTJxlKxs3TQ Message-ID: Subject: extattr_set_* return type From: mdf@FreeBSD.org To: freebsd-hackers Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Mar 2013 21:38:29 -0000 Despite the man page correctly describing the return value for extattr_set_*, I thought recently that they returned 0/-1 for success/failure, not the number of bytes written, like write(2). This is because extattr_set_* is declared as returning an int, not an ssize_t. Both extattr_get and extattr_list return ssize_t, so this is inconsistent. The patch at http://people.freebsd.org/~mdf/0001-Fix-return-type-of-extattr_set_-and-fix-rmextattr-8-.patchfixes this. It compiles but it's untested. I don't think any compat shims are needed, since an old application will still sign extend and this will work (it's very unlikely anyone does extattr_set for 2GB or more). If anyone actually uses extattr on 64-bit, please test a new kernel but old userspace to be sure nothing is broken. I plan to commit this next week if I don't hear otherwise. Thanks, matthew