]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
db: ensure that create and replace are exclusive in attr_set_f
authorChristoph Hellwig <hch@lst.de>
Mon, 11 May 2020 20:48:25 +0000 (16:48 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Mon, 11 May 2020 20:48:25 +0000 (16:48 -0400)
Clear the other flag when applying the create or replace option,
as the low-level libxfs can't handle both at the same time.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
db/attrset.c

index e35752711505b9eb57dd4bdbc7602b0f39ef030b..b86ecec70912348b53a51a77b4b7b1e5e795ee18 100644 (file)
@@ -99,9 +99,11 @@ attr_set_f(
                /* modifiers */
                case 'C':
                        args.attr_flags |= XATTR_CREATE;
+                       args.attr_flags &= ~XATTR_REPLACE;
                        break;
                case 'R':
                        args.attr_flags |= XATTR_REPLACE;
+                       args.attr_flags &= ~XATTR_CREATE;
                        break;
 
                case 'n':